Question: Modify the HeapIntPriorityQueue class written in this chapter to make it configurable in ways similar to Javas PriorityQueue class. Make it possible for the heap
Modify the HeapIntPriorityQueue class written in this chapter to make it configurable in ways similar to Java’s PriorityQueue class. Make it possible for the heap to be a min-heap or max-heap. (If you create a heap of objects, you could also modify it to accept a Comparator parameter to its constructor.)
Step by Step Solution
3.46 Rating (172 Votes )
There are 3 Steps involved in it
Here is the modified code for HeapPriorityQueue class I have created a variable to store the Comparator that will be comparing elements throughout the class In the default constructor this comparator ... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
2079_61d6ac3452ed3_861053.pdf
180 KBs PDF File
2079_61d6ac3452ed3_861053.docx
120 KBs Word File
