Question: Construct a heap with the following keys 6 , 8 , 2 , 3 , 9 , 4 , 7 , 1 , 5 >

Construct a heap with the following keys 6,8,2,3,9,4,7,1,5>.
[Hints: insert keys/ items to the heap one by one or construct the heap using bottom-up
approach]
[20 marks]
What will be the index value of the item with key '25' for an array-based representation of
the heap shown in figure 1?
[10 marks]
Figure 1: Min heap showing the keys of the items
Perform remove min operation once on the heap shown in figure 1.
Insert an item with key '4' in the heap shown in figure 1.
If there are 120items in a heap, then calculate the maximum number of swap operations
needed for adding or removing an item from a heap.
Construct a heap with the following keys < 6 , 8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!