org.plasma.common.sort
Class Sorter

java.lang.Object
  extended by 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.


Constructor Summary
Sorter()
           
 
Method Summary
abstract
<T extends Comparable<? super T>>
void
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
 

Constructor Detail

Sorter

public Sorter()
Method Detail

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 © 2013. All rights reserved.