1. Suppose we start with a max heap (a 1-indexed list A) containing the following elements not [12 pts] in the order given: {10, 20, 30, 40, 50, 60, 70} We swap A[1] and A[7], chop off A[7], then run maxheapify on A[1]. Suppose we know what A looks like after this process and we know where 20 was before this process. What the rest of it look like before? Index 1 2 3 4 567 A, before process 70 A, after process 60 50 30 40 20 Put scratch work below; Scratch work is not graded: 20 10 10 -

icon
Related questions
Question
1. Suppose we start with a max heap (a 1-indexed list A) containing the following elements not [12 pts]
in the order given:
{10, 20, 30, 40, 50, 60, 70}
We swap A[1] and A[7], chop off A[7], then run maxheapify on A[1].
Suppose we know what A looks like after this process and we know where 20 was before this
process. What the rest of it look like before?
Index
1
2
3
4
567
A, before process
70
A, after process
60
50 30
40 20
Put scratch work below; Scratch work is not graded:
20
10
10
-
Transcribed Image Text:1. Suppose we start with a max heap (a 1-indexed list A) containing the following elements not [12 pts] in the order given: {10, 20, 30, 40, 50, 60, 70} We swap A[1] and A[7], chop off A[7], then run maxheapify on A[1]. Suppose we know what A looks like after this process and we know where 20 was before this process. What the rest of it look like before? Index 1 2 3 4 567 A, before process 70 A, after process 60 50 30 40 20 Put scratch work below; Scratch work is not graded: 20 10 10 -
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer