What are the operations that could be performed in O(logn) time complexity by red-black tree?

Thanh Thảo

New member
What are the operations that could be performed in O(logn) time complexity by red-black tree?
A. insertion, deletion, finding predecessor, successor
B. only insertion
C. only finding predecessor, successor
D. for sorting
 
Answer: A
Explanation: We impose restrictions to achieve logarithm time complexities.
impose restrictions are:
. root property is black
. every leaf is black
. children of red node are black
. all leaves have same black.
 

Tìm kiếm

Back
Top