a. [10 marks] Given the elements in the following, draw the AVL-tree: 16, 15, 14, 3, 2, 1, 4, 5, 6, 7.
b. We know that a binary tree can be implemented using an array with the array index properties. You are
given the following corresponding array of an arbitrary binary tree, which is also a max-heap.
Element 10
6
8
5
2
4
1
Index 0
1
2
3
4
5
6
7
8
9
(i) [5 marks] In the max-heap, insert the element 18, and then insert the element 11. After each insertion,
you need to show the corresponding array of the updated max-heap.
(ii) [5 marks] From the updated max-heap in (a), delete the element 10. Then, delete the element 8. After
each deletion, you need to show the corresponding array of the updated max-heap.