- A I Let 12 37 7 73 146 148 231 72 25 Be The Elements Of An Array A Which Represents A Binary Tree T Such Tha 1 (27.83 KiB) Viewed 46 times
(a) (i) Let 12, 37, 7, 73, 146, 148, 231, 72, 25 be the elements of an array A which represents a binary tree T such tha
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
(a) (i) Let 12, 37, 7, 73, 146, 148, 231, 72, 25 be the elements of an array A which represents a binary tree T such tha
(a) (i) Let 12, 37, 7, 73, 146, 148, 231, 72, 25 be the elements of an array A which represents a binary tree T such that for node A in T, the leftson and rightson are A[2i] and A[2i + 1] respectively. Draw the binary tree which the array A represents. (ii) Convert the tree into a maxheap. Show the tree after each iteration of your loop condition. You should make reference to the algorithm HeapBottomUp in Appendix F. (iii) Briefly outline how Heapsort sorts a list of n items in non-decreasing order. (iv) You are given a list of one million numbers which are in a random order. You are required to return a sorted list. Which sorting algorithm would you use? Justify you choice.