Answered step by step
Verified Expert Solution
Question
1 Approved Answer
5. (10 points) Consider the array A = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10. a. (5 points) After we call Build-Heap(A),
5. (10 points) Consider the array A = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
a. (5 points) After we call Build-Heap(A), what are the last 3 elements of the ar-
ray?
A. 3,2,1
B. 1,3,2 C. 4,3,1 D. 1,4,2
b. (5 points) When we do one iteration of Heapsort, how many swaps are made in Heapify to restore the array to heap? Count the swap between the root and the last nodes as the first swap.
A. 2 B. 3 C. 4 D. 5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started