All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cynosurex.util.SortRoutines

java.lang.Object
   |
   +----cynosurex.util.SortRoutines

public class SortRoutines
extends Object
implements CommonInterface

Constructor Index

 o SortRoutines()

Method Index

 o bubbleSort(Object[], SortFilter)

The Bubble Sort is always very slow, no matter what data it is sorting.

 o sort(Object[], SortFilter)

This method is a generic sort routine that calls another sort algorithm in this class.

Constructors

 o SortRoutines
 public SortRoutines()

Methods

 o bubbleSort
 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.

 o sort
 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