Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
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