edu.gwu.algtest
Interface SelectionAlgorithm

All Superinterfaces:
edu.gwu.algtest.Algorithm

public interface SelectionAlgorithm
extends edu.gwu.algtest.Algorithm

Interface SelectionAlgorithm is to be implemented by algorithms that perform the selection function: returning the k smallest items in a data set in sort order.

See Also:
Algorithm

Method Summary
 java.lang.Comparable[] findKSmallest(int K, java.lang.Comparable[] data)
          This version of findKSmallest works with arrays of type Comparable.
 int[] findKSmallest(int K, int[] data)
          Method findKSmallest should return the the K smallest items in the array data.
 
Methods inherited from interface edu.gwu.algtest.Algorithm
getName, setPropertyExtractor
 

Method Detail

findKSmallest

public int[] findKSmallest(int K,
                           int[] data)
Method findKSmallest should return the the K smallest items in the array data in sorted order. That is, the elements of the return array should be sorted in increasing order. Note: it is the responsibility of the method to create the space for the int array that is to be returned.
Parameters:
K - an int value
data - an int[] value
Returns:
an int[] value

findKSmallest

public java.lang.Comparable[] findKSmallest(int K,
                                            java.lang.Comparable[] data)
This version of findKSmallest works with arrays of type Comparable.
Parameters:
K - an int value
data - a Comparable[] value
Returns:
a Comparable[] value