All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----cynosurex.util.SortRoutines
The Bubble Sort is always very slow, no matter what data it is sorting.
This method is a generic sort routine that calls another sort algorithm in this class.
public SortRoutines()
public void bubbleSort(Object objects[], SortFilter filter)
The Bubble Sort is always very slow, no matter what data it is sorting. However, it allocates no new memory address space, which is good for machines with low memory.
A Bubble Sort always runs in n^2 time and is a very poor choice for a sorting algorithm in any circumstance.
public void sort(Object objects[], SortFilter filter)
This method is a generic sort routine that calls another sort algorithm in this class. Its purpose is to point to the best sort algorithm as they are implemented, thus saving you the headache of changing your codes.
At times, there will be no "best" algorithm, since efficiency (speed) and memory allocation (space) are inversely proportional. This method will attempt to balance the the speed and the space by picking an algorithm with a better compromise.
If your program need a strict control on the speed or space issue, call a specific sort algorithm instead.
Currently, this method calls the Bubble Sort algorithm.
All Packages Class Hierarchy This Package Previous Next Index