3. (a) Show how binary search works when searching for 17 in the following array: 10 12 14 1 5 6 9 (5 marks) (b) What is
Posted: Fri Jul 08, 2022 7:25 am
3. (a) Show how binary search works when searching for 17 in the following array: 10 12 14 1 5 6 9 (5 marks) (b) What is a binary search tree (BST)? Mention any specific advantage or possible disadvantage. What is the complexity of searching a BST? (c) Write in pseudocode the algorithm for searching a BST. 17 32 (6 marks) (d) Given the following binary search tree, show how it would be modified by inserting 54. 44 48 50 17 21 78 62 (6 marks) 88 (5 marks) (e) What is an AVL-tree? Include in your answer the idea of a rotation. Show how the tree that results from inserting 54 in part (d) would be rebalanced if it were an AVL-tree. (11 marks)