In this project, you will construct an implementation of the Priority Queue interface using a heap. Your constructor for making a Priority Queue should be able to take a Comparator object as an argument, and it should use Comparators to do all comparisons (your default Comparator should be able to perform comparisons of Integer objects). Your heap data structure should be built using the binary tree interface, and this interface should be implemented using an array. Note: you may augment your binary tree class to add a method for identifying the last node.
Given your priority queue, you are then to use it to sort a sequence of 30 integers, which you should generate at random in the range 1 to 50. Your algorithm will therefore be the heapsort algorithm.
The assignment, then, is to build a class that implements each method in the Priority Queue ADT. Since this is implemented using a heap, which in turn is implemented using a simple binary tree, this assignment involves you producting other classes as well:
You are to demonstrate your classes in a main() method inside your HeapPriorityQueue class. This main() method should print the 30 random numbers, sort them via heapsort, and then print them in sorted order.
The following files are provided to help guide your software development: