Package algorithmcomparison
Class Heapsort
java.lang.Object
algorithmcomparison.Heapsort
Heapsort
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Heapsort
public Heapsort()
-
-
Method Details
-
sort
public static int[] sort(int[] data) Sorts the data with heap sort- Parameters:
data- The unsorted data- Returns:
- arr
-
heapify
public static void heapify(int[] arr, int n, int i) Builds a heap from array
-