Solution Found!
3 Show the result of performing three deleteMin operations in the heap of theprevious
Chapter 6, Problem 6.3(choose chapter or problem)
3 Show the result of performing three deleteMin operations in the heap of theprevious exercise.
Questions & Answers
QUESTION:
3 Show the result of performing three deleteMin operations in the heap of theprevious exercise.
ANSWER:Step 1 of 2
Consider that the below heap to apply the deleteMin operation:
The deleteMin operation deletes the minimum value from the heap, which is the root. In a heap above, when 1 is deleted, the root candidates will be 3 and 2. To satisfy the heap order, choose the minimum value that is 2. This follows down the length of the heap in a similar fashion. The heap after the first deletion is given below:
The second deleteMin operation will delete the next minimum value from the heap, which is the root again. In the heap above, when 2 will be deleted, the candidates for the root will be 3 and 4. To satisfy the heap order, choose the minimum value that is 3. This follows down the length of the heap in a similar fashion. The heap after the second deletion is given below: