Question: In Data Structure: 1. Suppose in an AVL tree the following items are inserted in the given order: 29, 18, 11, 23, 38, 6, 16,
In Data Structure:
1. Suppose in an AVL tree the following items are inserted in the given order: 29, 18, 11, 23, 38, 6, 16, 19, 17, 25, 26, 27, 3 a. Show (draw) the construction of the tree. [Anytime you apply a rotation to restore AVL balance, indicate the rotation types.] b. Now, suppose the root of the tree (containing these 13 items) is deleted from the tree. Show the resulting AVL tree after the deletion. [6 + 3 = 9 points] 2. Write a method using Java syntax that takes a reference Root to the root of a binary tree (the tree is not necessarily a binary search tree) and returns the total number of terminal nodes (leaves) in the tree. You may use the Node class (structure) provided on the slides. [5 points] int TerminalNodes(BTNode Root){ } 3. Create a level-order binary tree using following numbers (in the given order): 5, 22, 19, 56, 50, 25, 1, 3, 10, 6, 32, 12, 11 Now heapify, using the buildHeap() method, the above level-order tree to construct a min-binary heap (draw the resulting min-heap).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
