Create a programme to build a heap with the items 10, 2, 9, 16, 8, 6, 1, 3, 12. At each important phase in the creation, you must sketch the heap (as a binary tree). (a) Placing the elements in the given order into an empty heap. (b) As in heapsort, building the heap from the bottom up.

icon
Related questions
Question

Create a programme to build a heap with the items 10, 2, 9, 16, 8, 6, 1, 3, 12. At each important phase in the creation, you must sketch the heap (as a binary tree). (a) Placing the elements in the given order into an empty heap. (b) As in heapsort, building the heap from the bottom up.

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer