(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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
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

Post by answerhappygod »

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
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 47 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 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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply