Answered step by step
Verified Expert Solution
Link Copied!

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
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions

Question

We are of the conviction that writing is important.

Answered: 1 week ago