Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Given the above AVL tree, 1. Insert 36. Where will it be located? 2.After insert

ID: 3903880 • Letter: G

Question

Given the above AVL tree,

1. Insert 36. Where will it be located?

2.After inserting 36, what is the balance factor of the node that stores 36?

3. After inserting 36, what's the balance factor of A?

  

4. After inserting 36, what's the balance factor of B?

5. After inserting 36, what's the balance factor of C?

6. After inserting 36, what's the balance factor of D?

  

7. After inserting 36, what's the balance factor of E?

8. After inserting 36, what's the balance factor of J?

9. After inserting 36, what's the balance factor of K?

10. What imbalance case is present if any?

11. What rebalance action is applied?

12. Around which node is the rebalance action centered?

  

13. What's the value of A after the rebalancing action is applied?

  

14. What's the value of B after the rebalancing action is applied?

15. What's the value of C after the rebalancing action is applied?

16. What's the value of D after the rebalancing action is applied?

  

17. What's the value of E after the rebalancing action is applied?

18. What's the value of F after the rebalancing action is applied?

  

19. What's the value of H after the rebalancing action is applied?

20. What's the value of I after the rebalancing action is applied?

21. What's the value of J after the rebalancing action is applied?

22. What's the value of K after the rebalancing action is applied?

7 2 1 5 1

Explanation / Answer

1. It will come to the right of 35(k) (Rebalancing is yet to be done)
2. 0                         // height of left subtree - height of right subtree
3. 2

4 -2
5 1
6.0

7 -1
8. 0
9 0

10 (36 has caused the imablance) (Every node should have balancing factor as
   -1, +1, or 0 but beacuse of 36 nodes balancing factors are not as requires
    so rebalancing act is required.

11. Left Rotation is required

12. Node B
13 No change
14. 32
15. No change
16 29
17 35
18 No change
19.18
20 31
21 . No value
22 36

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote