|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpal.util.HeapSort
public class HeapSort
sorts numbers and comparable objects by treating contents of array as a binary tree. KNOWN BUGS: There is a horrible amount of code duplication here!
Constructor Summary | |
---|---|
HeapSort()
|
Method Summary | |
---|---|
static double[] |
getSorted(double[] array)
|
static void |
main(java.lang.String[] args)
test harness for heapsort algorithm |
static void |
sort(Comparable[] array)
Sorts an array of comparable objects into increasing order. |
static void |
sort(double[] array)
Sorts an array of doubles into increasing order. |
static void |
sort(double[] array,
int[] indices)
Sorts an array of indices into an array of doubles into increasing order. |
static void |
sort(java.lang.Object[] array,
Comparator c)
Sorts an array of objects into increasing order given a comparator. |
static void |
sort(java.util.Vector array)
Sorts a vector of comparable objects into increasing order. |
static void |
sort(java.util.Vector array,
int[] indices)
Sorts an array of indices to vector of comparable objects into increasing order. |
static void |
sortAbs(double[] array)
Sorts an array of doubles into increasing order, ingoring sign. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HeapSort()
Method Detail |
---|
public static void sort(java.util.Vector array, int[] indices)
public static void sort(java.util.Vector array)
public static void sort(Comparable[] array)
public static void sort(java.lang.Object[] array, Comparator c)
public static final double[] getSorted(double[] array)
public static void sort(double[] array)
public static void sortAbs(double[] array)
public static void sort(double[] array, int[] indices)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |