Question: Code the insert and changeKey methods for the MaxHeap class given. Write JUnit test to test your code import static org.junit.Assert. import java.util.ArrayList import org.junit.Before:

Code the insert and changeKey methods for the MaxHeap class given. Write JUnit test to test your code
 Code the insert and changeKey methods for the MaxHeap class given.
Write JUnit test to test your code import static org.junit.Assert. import java.util.ArrayList
import org.junit.Before: import org junit.Testi public class MaxHeapTest private MaxHeap heap: eBefore
public void setUp) throws Exception heap new MaxHeap (10) heap.insert (new Student("Susan",

import static org.junit.Assert. import java.util.ArrayList import org.junit.Before: import org junit.Testi public class MaxHeapTest private MaxHeap heap: eBefore public void setUp) throws Exception heap new MaxHeap (10) heap.insert (new Student("Susan", 60, 3.5)) heap.insert (new Student("Ben 70. 3.4)) heap.insert (new Student( "Reed, 120, 4.0)) heap.insert (new student "Johnny",50, 1.2) Test public void test assertEquals (4.0, heap.extractMax().gpa000001) assertEquals (3.5, heap.extractMax().gpa), .000001)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!