Question
Name your class PQSort and put it in the default package. Inside, create the following two public methods: static > void heapSort(E[] a) static >
Name your class PQSort and put it in the default package. Inside, create the following two public methods: static > void heapSort(E[] a) static > void heapSort2011(E[] a) Both of these methods should implement a heap sort algorithm using priority queues (not-in-place kind). The first method should rely on the java.util.PriorityQueue implementation, and the second one on the priority queue you implemented in Part 1. NB: These methods can literally be implemented in three lines each. Test the methods to ensure they work correctly (and produce the same result). The order is non-decreasing.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started