in DS edited by
1,407 views
1 vote
1 vote

AVL tree is created by inserting the keys 2, 6, 1, 5, 3, 4, 7 in the given order (Assume the tree is initially empty). Then the level order traversals of the tree would be.

  1. 2, 1, 3, 5, 4, 6, 7
  2. 3, 2, 5, 1, 6, 4, 7
  3. 2, 1, 3, 4, 5, 6, 7
  4. 3, 2, 5, 1, 4, 6, 7

I know this a very easy question but recently I realized that I am facing problems in the rotations even after knowing all the concepts. After 2 or 3 rotations I get stuck trying to figure out which way to rotate.

Please help me with the proper steps in this question. 

in DS edited by
1.4k views

4 Comments

Given option is correct , you must have done some mistake while doing rotations . Kindly post your solution
0
0
i have done same rotation but i am getting different order

LEVEL ORDER--> Root, Left, Right

than i am getting (3,  2,  1,  5,  4,  6, 7)
0
0
0
0

1 Answer

0 votes
0 votes

Related questions