(b) Use heapsort to put the numbers 3,4, 1, 9, 8, 2,5 in decreasing order. You may use either the tree or the array repr
Posted: Fri Jul 08, 2022 6:35 am
(b) Use heapsort to put the numbers 3,4, 1, 9, 8, 2,5 in decreasing order. You may use either the tree or the array representation. (3 marks) (i) Explain/show clearly how the initial heap is established. (ii) Show the heap and the partially sorted list obtained at each stage. (6 marks)