AVL Tree - Sajha Mobile
SAJHA MOBILE
AVL Tree
Posts 3 · Viewed 4030 · Likes 1 · Go to Last Post
gunrukekancho
· Snapshot 0
Like · Likedby · 0
can you find solution for question a and b please?

Stiffler
· Snapshot 23
Like · Liked by · 1
Diy

Do it yourself
syal
· Snapshot 20
Like · Liked by · 0
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
Please log in to reply to this post

You can also log in using your Facebook
View in Desktop
What people are reading
You might like these other discussions...
· Posts 1 · Viewed 139
· Posts 4 · Viewed 543
· Posts 2 · Viewed 247
· Posts 12 · Viewed 1593 · Likes 3
· Posts 5 · Viewed 459
· Posts 1 · Viewed 91
· Posts 1 · Viewed 79
· Posts 7 · Viewed 600
· Posts 9 · Viewed 744
· Posts 12 · Viewed 1102 · Likes 1



Your Banner Here
Travel Partners
Travel House Nepal