The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
71 views

Image may contain: text

asked in CBSE/UGC NET by Boss (49.3k points)
edited by | 71 views

1 Answer

0 votes
option B) $O(lg n)$

Red-Black trees are always 'balanced' means at any moment both the left and right subtrees will be nearly of the same height (maximum difference between heights is 1).

Search: The worst case is when node being searched is a leaf node. This takes lg n time which is the height of the tree.

Insert: The worst case happens when every node from root to the leaf has to be balanced which can be done in lg n time.

Delete: The worst case happens when every node from the node to root has to be balanced which can be done in lg n time.

So the worst case is time is $O(lgn)$
answered by Junior (739 points)
edited by
0
how????
–1
+1
@ venkat

see one thing, U r answering, its fine but u know along with it if u could answer in some informative way so that other people can also take help from it...
0
@venkat_sirvisetti, Can you please support your answer with an Example?Say?


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

39,828 questions
46,802 answers
140,990 comments
58,948 users