edu.gwu.algtest
Interface SortingAlgorithm

All Superinterfaces:
Algorithm

public interface SortingAlgorithm
extends Algorithm

interface SortingAlgorithm needs to be implemented by any sorting algorithm tested by the AlgorithmTest environment.


Method Summary
 int[] createSortIndex(java.lang.Comparable[] data)
          createSortIndex should return a sort index for Comparable
 int[] createSortIndex(int[] data)
          Instead of modifying the order of data in the original array, createSortIndex should create and return an array of indices into the original array in sort order.
 void sortInPlace(java.lang.Comparable[] data)
          sortInPlace sorts object arrays that meet the Comparable interface so that comparisons may be done by called the compareTo method of the objects.
 void sortInPlace(int[] data)
          sortInPlace should sort the given integer data in the same array.
 
Methods inherited from interface edu.gwu.algtest.Algorithm
getName, setPropertyExtractor
 

Method Detail

sortInPlace

public void sortInPlace(int[] data)
sortInPlace should sort the given integer data in the same array.
Parameters:
data - an int[] value

sortInPlace

public void sortInPlace(java.lang.Comparable[] data)
sortInPlace sorts object arrays that meet the Comparable interface so that comparisons may be done by called the compareTo method of the objects.
Parameters:
data - a Comparable[] value

createSortIndex

public int[] createSortIndex(int[] data)
Instead of modifying the order of data in the original array, createSortIndex should create and return an array of indices into the original array in sort order. Thus, if data[0]=10, data[1]=15, data[2]=5 the returned array should contain 2, 0, 1.
Parameters:
data - an int[] value
Returns:
an int[] value

createSortIndex

public int[] createSortIndex(java.lang.Comparable[] data)
createSortIndex should return a sort index for Comparable
Parameters:
data - a Comparable[] value
Returns:
an int[] value