Question: Write the JUnit tests to test all cases of MaxHeap.java. The test cases should cover all parts of the code Quick Access MasHieap javaD Student

Write the JUnit tests to test all cases of MaxHeap.java. The test cases should cover all parts of the code Write the JUnit tests to test all cases of MaxHeap.java. The test

cases should cover all parts of the code Quick Access MasHieap javaD

Student java e import jova.util.ArrayList: 4 public class MaxHeap 6 private ArrayListStudents

Quick Access MasHieap javaD Student java e import jova.util.ArrayList: 4 public class MaxHeap 6 private ArrayListStudents students; public MaxHeapCint capacity) tudents-new Arraylist-Student (copacity): 13 public MaxHeap(Collection Student collection) 15 16 17 18 19 students- new ArrayList Student (coltection): maxHeopi fyCi) 21 22e public Student getMax() ifCsizeO1) throw new IndexoutOfBoundsExceptionC"No moximum volue: the heap is empty. return students.get) public Student extractMaxO) 32 Student value - getMax; students. setC,students.get(size)-1)) students, renove(size-1) maxHleopify(e) return value; 35 students: ArrayListcStudent geeMax() : Student extractMaxD:Student 1 public void insert (Student elt) insert(Student):void //Please write me students.addCelt) int s - sizeO a parentlint): int B left(int): int a rightint): Int Asize) while(sstudents.get(s-1).corporeTo(students.get(parent(s.1)))>{ swopCs-1, parents-1) s parent(s).1 swap(int, int) void maxHeapify(int) void 51 S2 3 public void changeKey(Student s, double nenGPA) //Please write ne int indexOfStudent students.indexOfCs); ifCindexDfStudent 1 -1) s.setGPACnewGPA); Smart insert 4:17 Quick Access MasHieap javaD Student java e import jova.util.ArrayList: 4 public class MaxHeap 6 private ArrayListStudents students; public MaxHeapCint capacity) tudents-new Arraylist-Student (copacity): 13 public MaxHeap(Collection Student collection) 15 16 17 18 19 students- new ArrayList Student (coltection): maxHeopi fyCi) 21 22e public Student getMax() ifCsizeO1) throw new IndexoutOfBoundsExceptionC"No moximum volue: the heap is empty. return students.get) public Student extractMaxO) 32 Student value - getMax; students. setC,students.get(size)-1)) students, renove(size-1) maxHleopify(e) return value; 35 students: ArrayListcStudent geeMax() : Student extractMaxD:Student 1 public void insert (Student elt) insert(Student):void //Please write me students.addCelt) int s - sizeO a parentlint): int B left(int): int a rightint): Int Asize) while(sstudents.get(s-1).corporeTo(students.get(parent(s.1)))>{ swopCs-1, parents-1) s parent(s).1 swap(int, int) void maxHeapify(int) void 51 S2 3 public void changeKey(Student s, double nenGPA) //Please write ne int indexOfStudent students.indexOfCs); ifCindexDfStudent 1 -1) s.setGPACnewGPA); Smart insert 4:17

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!