What is the time complexity for splitting the string into two new string in the rope data structure?

Bảo Vy

Member
What is the time complexity for splitting the string into two new string in the rope data structure?
A. O (n$^{2}$)
B. O (n!)
C. O (log n)
D. O (1)
 
Answer: c
Explanation: In order to perform the splitting on the rope data structure, one can split the given string into two new string S1 and S2 in O (log n) time. So, the time complexity for worst case is O (log n).
 

Tìm kiếm

Back
Top