Search for question

the following order: [18, 14,17, 42, 11, 25, 15, 47]. Show the resulting tree. [6 marks] (b) Put the following items into the BST in Figure la [20, 25, 26, 30, 35,40, 42, 47, 60]. Is this always unique for a fixed array and a fixed BST?Justify your answer. 6 marks (c) Mark all non-balanced nodes in the BST in Figure la. Justify your[6 marks]answer. (d) In the BST you got in the part (b) delete the following items, in the following order: [40, 35, 25] (So when deleting 35, 40 is not in the tree any-more ...). Show how the BST changes in each deletion. [6 marks] (e) Consider the BST in Figure lb. The node 25 can be raised to be the root of the BST using 2 rotations ( each of the rotations "promotes"25 to the place of its parent). Show the state of the tree after each of these rotations. [6 marks]

Fig: 1

Fig: 2

Fig: 3

Fig: 4

Fig: 5

Fig: 6

Fig: 7