Question: / / The Homework 6 class that implements sorting and heap methods / / your name here public class Homework { / / student comparison

// The Homework6 class that implements sorting and heap methods
// your name here
public class Homework
{
// student comparison
public int compares(Student s1, Student s2)
{
// TODO: implement this method
return -1; // replace this statement with your own return
}
// This is the wrapper method for quick sort
// Do not make any changes to this method!
public void quickSort(Student[] studentArray)
{
quickSortRec(studentArray,0, studentArray.length -1);
}
// This is the recursive helper method for quickSort that sorts the students based on their GPAs in
// increasing order.
// Note: If two students have the same GPA, then the one with lower student ID should show up in front of
// the one with higher ID.
public void quickSortRec(Student[] studentArray, int first, int last)
{
// TODO: implement this method
}
// This method splits a Student array into two sections, with all the elements less than the pivot in the
// left section and all the elements greater than the pivot in the right section
public int split(Student[] studentArray, int first, int last)
{
// TODO: implement this method
return -1; // replace this statement with your own return
}
// This method takes an int array which represents a complete binary tree as
// the parameter. It checks if the tree stored in the array is a heap.
public boolean isHeap(int[] A)
{
// TODO: implement this method
return false; // replace this statement with your own return
}
}
/ / The Homework 6 class that implements sorting

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 Programming Questions!