AVL Tree

Archived from the original Sajha.com — preserved as posted, replies can no longer be added here.
Start a New Discussion
Archived Post

can you find solution for question a and b please?

gunrukekancho · Oct 18, 2010 11:37 AM · 11,133 views

2 Replies

Diy Do it yourself

Stiffler · Oct 18, 2010 12:47 PM

a) After inputting 52, which first goes to the left child of 54, it creates imbalance for the 62(as its height from left child becomes 5 and right child becomes 3 which is again the rule of AVL tree. So, we have rearrange which leads to 48 as the left child of 62 replacing 44 (44 becomes left child of this new 48 and 17 also becomes left child of this new 44) on the other side everything remains the same except 52 comes to the place of the old 48, this way the height of the 62 is still 4.b) Removing 62, 50 goes to the place of 62, while 48 goes to the place of 50 and 54 goes to the left child of the 78 I hope it was helpful

syal · Oct 18, 2010 4:52 PM

This conversation is preserved exactly as it was on the original Sajha.com and can't accept new replies.

Start a New Discussion

You might be interested in...

Recent Classifieds View all
Upcoming Events View all
Service Providers View all