Question: Write a method in the HeapIntPriorityQueue class called merge that accepts another HeapIntPriorityQueue as a parameter and adds all elements from the other queue into
Write a method in the HeapIntPriorityQueue class called merge that accepts another HeapIntPriorityQueue as a parameter and adds all elements from the other queue into the current queue, maintaining proper heap order such that the elements will still come out in ascending order when they are removed. Your code should not modify the queue passed in as a parameter. (Recall that objects of the same class can access each other’s private fields.)
Step by Step Solution
3.28 Rating (160 Votes )
There are 3 Steps involved in it
public voi... View full answer
Get step-by-step solutions from verified subject matter experts
