Let A be an array consisting of elements in the following order
29,30, 25,36, 34,72, 15, 17, 11
(a) Draw the binary search tree that is obtained by adding/inserting the elements (without balancing) in the order they appear in the array.
(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 adding the above elements using the hash function (3x+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, it 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)?
“Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!”
What Students Are Saying About Us.......... Customer ID: 12*** | Rating: ⭐⭐⭐⭐⭐
"Honestly, I was afraid to send my paper to you, but splendidwritings.com proved they are a trustworthy service. My essay was done in less than a day, and I received a brilliant piece. I didn’t even believe it was my essay at first 🙂 Great job, thank you!"
.......... Customer ID: 14***| Rating: ⭐⭐⭐⭐⭐
"The company has some nice prices and good content. I ordered a term paper here and got a very good one. I'll keep ordering from this website."