Question: Show steps. Please. 1. Let A be an array consisting of elements in the following order 21,30, 25,36, 34,35, 15, 17, 12 (a) Draw the

 Show steps. Please. 1. Let A be an array consisting of

Show steps. Please.

1. Let A be an array consisting of elements in the following order 21,30, 25,36, 34,35, 15, 17, 12 (a) Draw the binary search tree that is obtained by adding/inserting the elements (without (b) If the resulting tree is not balanced, perform balancing as per AVL tree discussed in balancing) in the order they appear in the array. lectures. Specify the steps needed to balance (left rotation/right rotation etc) and draw the resulting balanced tree. (c) Draw the hash table (using chain hashing) obtained by by adding the above elements using the hash function (4x+1)%5. (d) For a BST T and a node N in T, let B(N) = height of left sub tree of N-height of right subtree of N. Note that B(N) could be positive, negative or 0. Let T be the following BST: The root node is X, t has a left subtree named R and a right subtree rooted at Y. The node Y has a right subtree Z and a left subtree rooted at node U. The node U has two sub trees V and W. Suppose that B(U) = 0. B(Y)-1 and B (X)--2 Draw the tree obtained by balancing T. Draw the intermediate trees (if any) obtained while balancing. Once you balance the tree, what are B(X), B(Y) and B(U)1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!