A. Draw a binary search tree based on the sequence of numbers inserted in the following order: {2, 4, 8, 6, 0, 5, 3, 9, 1, 7}. The numbers are inserted into an initially-empty binary search tree. b. Using the same sequence of numbers in Question a. draw the AVL tree. The numbers are inserted into an initially-empty AVL tree. c. From your answer for Question a. and b. discuss insertion analysis of both tree structures. Also discuss how “Lack of balance” problem solve in one of the tree. d. Assuming that the binary search tree in Figure 1 stores integer values that does not have any duplicate elements. Give the range (in the form m – n) of all values which could occupy the node ‘x’. Describe and show the step of rearranging nodes from the binary search tree in Figure 2, when the following nodes are deleted in sequence: node 5 node 63
A. Draw a binary search tree based on the sequence of numbers inserted in the following order: {2, 4, 8, 6, 0, 5, 3, 9, 1, 7}. The numbers are inserted into an initially-empty binary search tree.
b. Using the same sequence of numbers in Question a. draw the AVL tree. The numbers are inserted into an initially-empty AVL tree.
c. From your answer for Question a. and b. discuss insertion analysis of both tree structures. Also discuss how “Lack of balance” problem solve in one of the tree.
d. Assuming that the binary search tree in Figure 1 stores integer values that does not have any duplicate elements. Give the range (in the form m – n) of all values which could occupy the node ‘x’.
Describe and show the step of rearranging nodes from the binary search tree in Figure 2, when the following nodes are deleted in sequence:
-
-
node 5
-
node 63
-
Step by step
Solved in 2 steps with 3 images