GATE CSE
First time here? Checkout the FAQ!
x
+2 votes
37 views

What are we suppose to take?

LR - 2 rotations.
RL-  2 rotations.

OR

LR - 1 rotation.
RL-  1 rotation.

Kindly Solve and Verify the Total Numbers of Rotations Performed.

asked in DS by Active (1.2k points)   | 37 views
is it 1LR and 1RL ?
Are you talking about Final Answer?
in total after all insertions i am getting 1RL, 1RR, 1LR.
Well , I am getting

1- RL
1-RL
1-LL
1-LL
In the same sequence in total at the End.
If asked about rotations simply , they should be taken as two as they are double rotation instances..
on 80 insertion no rotation, then atmax 3 [as only 3 insertions after this] should be there how you getting 4 ?
How can you say,@Gate Mission 1?Sir,  Have you tried it?

When you apply 2nd RL , the tree needs to get Rebalanced. And that's why it takes one more.

The answer Given is 5 and that Confuses me.

@jason, 

Use it for visualisation : https://www.cs.usfca.edu/~galles/visualization/AVLtree.html

I am not sir :) ...just an aspirant.

Please log in or register to answer this question.

Related questions

0 votes
3 answers
1
+2 votes
3 answers
2
0 votes
1 answer
3
asked in Databases by shubhamdarokar (161 points)   | 23 views
Top Users Jan 2017
  1. Debashish Deka

    8280 Points

  2. sudsho

    5042 Points

  3. Habibkhan

    4716 Points

  4. Vijay Thakur

    4468 Points

  5. Bikram

    4368 Points

  6. saurabh rai

    4212 Points

  7. Arjun

    4052 Points

  8. santhoshdevulapally

    3732 Points

  9. GateSet

    3312 Points

  10. Sushant Gokhale

    3306 Points

Monthly Topper: Rs. 500 gift card

19,138 questions
24,046 answers
52,772 comments
20,283 users