For this assignment, you will implement a priority queue using a binary heap. Your constructor must take in a BiPredicate that tells if the first argument is larger than the second.
In addition to the binary heap, you will also implement a solution to a common interview question that uses a priority queue. The problem is to find the K-largest elements in a list of N values. One approach to doing this is to run through all the values, adding each one to a min-priority queue. (That is a priority queue where the highest priority is the smallest value.) If the priority queue has more than K elements, you dequeue so it only has K. At the end of the loop, the priority queue will have K elements, and they will be the largest.
Your test code should include the following:
Tests with each of the methods you are to implement.
Tests with more than one type.
A test that has the elements come off in something other than the natural sort order.
A test of both the heap and the K-largest algorithm that includes at least 1000 elements.