Question: my code: public class Sorts { public static > void heapSort ( T [ ] array ) { int n = array.length; for ( int
my code:
public class Sorts
public static void heapSortT array
int n array.length;
for int i n ; i ; i
siftDownarray n i;
for int i n ; i ; i
T temp array;
array arrayi;
arrayi temp;
siftDownarray i;
private static void siftDownT array, int n int i
T temp arrayi;
int child;
while child i n
if child n && arraychild compareToarraychild
child;
if arraychildcompareTotemp
arrayi arraychild;
i child;
else
break;
arrayi temp;
Want to doublecheck fix my code. professor isn't helpful at all
Project
Due Nov by :pm
Points
Submitting a file upload
File Types java
Fast Sorting Algorithms
Implement a fast sorting algorithm as described in class. Here
is some example code beta to use as a guideline.
You need only implement the sorting algorithm; the main
method will be provided for you.
You must hand in the Sorts class with the
heapSort sorting algorithm implemented. This is the only
file you should hand in The heading of the method is as in the
provided file. Do not change it or you will lose credit!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
