org.plasma.common.sort
Class Sorter
java.lang.Object
org.plasma.common.sort.Sorter
- Direct Known Subclasses:
- BubbleSort, InsertionSort, MergeSort, QuickSort, SelectionSort, ShellSort
public abstract class Sorter
- extends Object
Information about each algorithm's time/memory complexity and stability
is provided in their respective classes.
n is the number of records to be sorted.
A sorting algorithm is stable if
whenever there are two records R and S with the same key
and with R appearing before S in the original list,
R will appear before S in the sorted list.
|
Method Summary |
abstract
|
sort(T[] a)
|
protected void |
swap(Object[] a,
int i,
int j)
Swap the contents of a[i] and a[j] |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Sorter
public Sorter()
swap
protected void swap(Object[] a,
int i,
int j)
- Swap the contents of a[i] and a[j]
sort
public abstract <T extends Comparable<? super T>> void sort(T[] a)
Copyright © 2014. All rights reserved.