In the given tree T below, answer the following questions and justify your answe
ID: 3833837 • Letter: I
Question
In the given tree T below, answer the following questions and justify your answer clearly. Give a depth and a height of a node of key J, the height of tree T, respectively. Is the tree T a complete binary' tree? Justify your answer. Traverse the tree T by postorder traversal and write the visited keys in order. Is the tree T a maximum heap? Justify your answer. Is the tree T an AVL tree? Justify your answer. If the above tree T were not an AVL tree, draw the final AVL tree, restoring the AVL property through the rotations. Show all of the steps of rotations.Explanation / Answer
(1) The height of tree T is four and the depth of node 50 is one.
(2) Tree T is not comple binary tree. This is beacuse each level, except the last level, is not completely filled.
(3) post order traversal: 5, 25, 15, 40, 35, 60, 50, 80, 70
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.