1. Insert the following elements in the given order to an empty binary (d = 2) max-heap. Draw out the tree representation of the heap after all elements are inserted. Then, store the array representation of the heap in variable output located within the method insertion Result. Elements to insert: [45, 22, 36, 50, 87, 25, 79, 51, 95, 90, 104, 5]

icon
Related questions
Question
1. Insert the following elements in the given order to an empty binary (d = 2)
max-heap. Draw out the tree representation of the heap after all elements are
inserted. Then, store the array representation of the heap in variable output
located within the method insertion Result.
Elements to insert: [45, 22, 36, 50, 87, 25, 79, 51, 95, 90, 104, 5]
Transcribed Image Text:1. Insert the following elements in the given order to an empty binary (d = 2) max-heap. Draw out the tree representation of the heap after all elements are inserted. Then, store the array representation of the heap in variable output located within the method insertion Result. Elements to insert: [45, 22, 36, 50, 87, 25, 79, 51, 95, 90, 104, 5]
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer