+1 vote
in Data Structures & Algorithms I by (110k points)
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

Query is from Red Black Tree in division Binary Trees of Data Structures & Algorithms I

This question was posed to me in unit test.

1 Answer

+1 vote
by (672k points)
selected by
 
Best answer
Correct option is (a) insertion, deletion, finding predecessor, successor

The explanation is: 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.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...