Phase 1: Add 10 items to an empty max heap. Starting with an empty max heap, add these numbers: 92 48 94 37 32 76 14 84 50 79 Draw the resulting heap, along with the order of the numbers in the array that represents the heap. Phase 2: Remove 4 items from the heap. Starting with the heap resulting from phase 1, remove the 4 largest items from the heap. Indicate the numbers that were removed, and in what order. Draw the resulting heap, along with the order of the numbers in the array that represents the hean

icon
Related questions
Question

I need help with this, please

Phase 1: Add 10 items to an empty max heap.
Starting with an empty max heap, add these numbers:

92, 48, 94, 37, 32, 76, 14, 84, 50, 79

Draw the resulting heap, along with the order of the numbers in the array that represents the heap.

Phase 2: Remove 4 items from the heap.
Starting with the heap resulting from phase 1, remove the 4 largest items from the heap. Indicate the numbers that were removed, and in what order. Draw the resulting heap, along with the order of the numbers in the array that represents the heap.

Phase 3: Add 3 items to the heap.
Starting with the heap resulting from phase 1, add these numbers:

23, 49, 29

Draw the resulting heap, along with the order of the numbers in the array that represents the heap.

Phase 4: Remove 4 items from the heap.
Starting with the heap resulting from phase 3, remove the 4 largest items from the heap. Indicate the numbers that were removed, and in what order. Draw the resulting heap, along with the order of the numbers in the array that represents the heap.

Phase 5: Add 3 items to the heap.
Starting with the heap resulting from phase 1, add these numbers:

74, 31, 40

Draw the resulting heap, along with the order of the numbers in the array that represents the heap.
Transcribed Image Text:Phase 1: Add 10 items to an empty max heap. Starting with an empty max heap, add these numbers: 92, 48, 94, 37, 32, 76, 14, 84, 50, 79 Draw the resulting heap, along with the order of the numbers in the array that represents the heap. Phase 2: Remove 4 items from the heap. Starting with the heap resulting from phase 1, remove the 4 largest items from the heap. Indicate the numbers that were removed, and in what order. Draw the resulting heap, along with the order of the numbers in the array that represents the heap. Phase 3: Add 3 items to the heap. Starting with the heap resulting from phase 1, add these numbers: 23, 49, 29 Draw the resulting heap, along with the order of the numbers in the array that represents the heap. Phase 4: Remove 4 items from the heap. Starting with the heap resulting from phase 3, remove the 4 largest items from the heap. Indicate the numbers that were removed, and in what order. Draw the resulting heap, along with the order of the numbers in the array that represents the heap. Phase 5: Add 3 items to the heap. Starting with the heap resulting from phase 1, add these numbers: 74, 31, 40 Draw the resulting heap, along with the order of the numbers in the array that represents the heap.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer