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.
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 |
public int[] findKSmallest(int K, int[] data)
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.K
- an int
valuedata
- an int[]
valueint[]
valuepublic java.lang.Comparable[] findKSmallest(int K, java.lang.Comparable[] data)
findKSmallest
works with
arrays of type Comparable
.K
- an int
valuedata
- a Comparable[]
valueComparable[]
value