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.6k 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?

Related questions

0 votes
1 answer
1
asked May 12, 2017 in CBSE/UGC NET by Sanjay Sharma Boss (49.6k points) | 93 views
+2 votes
1 answer
2
asked May 12, 2017 in CBSE/UGC NET by Sanjay Sharma Boss (49.6k points) | 110 views


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

42,599 questions
48,600 answers
155,664 comments
63,733 users