
sorts.Sorter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudgraph-common Show documentation
Show all versions of cloudgraph-common Show documentation
CloudGraph(tm) is a suite of Service Data Object (SDO) 2.1 services designed for relational and big-table style "cloud" databases, such as HBase and others.
package sorts;
/**
* Sorter.java
* Created by Stijn Strickx on May 21, 2008
* Copyright 2008 Stijn Strickx, All rights reserved
*/
/**
* 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.
*/
public abstract class Sorter {
/**
* Swap the contents of a[i] and a[j]
*/
protected void swap(Object[] a, int i, int j){
Object tmp = a[i];
a[i] = a[j];
a[j] = tmp;
}
public abstract > void sort(T[] a);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy