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 -
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 -
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
-](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fe0394dda-1230-46f2-92ff-9edb879436e7%2F151123ab-b664-4ba8-9335-ce202a1f7364%2Feqzr2z_processed.png&w=3840&q=75)
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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
