Question: JAVA MaxHeapTest.java: Develop a unit test for the MaxHeap class. Here is a test plan for MaxHeapTest.java. For example, a good test is to insert
JAVA
MaxHeapTest.java: Develop a unit test for the MaxHeap class. Here is a test plan for MaxHeapTest.java. For example, a good test is to insert a series of increasing (or decreasing or random) keys into the heap and then check if the heap was formed properly. Another good test is to extract all keys out of the heap using extractMax and that should give us a sorted list (basically, heapsort). If our heap is generic, it will be easier to write unit tests using a heap of Integer objects. If we arent writing a generic MaxHeap, then we would have to create some Task objects to insert and test the heap.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
