stresstests.algorithms
Class ArrSortSelection<T>
java.lang.Object
stresstests.algorithms.ASortAlgo<T>
stresstests.algorithms.ArrSortSelection<T>
public class ArrSortSelection<T>
- extends ASortAlgo<T>
ArrSortSelection 22 March 2007
A class to represent one sorting algorithm
- Author:
- Viera K. Proulx
Field Summary |
java.util.ArrayList<T> |
data
|
Method Summary |
int |
findMinIndex(int low)
|
void |
initData(Traversal<T> tr)
Initialize the internal data set with the data generated by the
Traversal |
static void |
main(java.lang.String[] argv)
|
Traversal<T> |
sort()
sort the data set with respect to the current
Comparator |
void |
swap(int index1,
int index2)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
data
public java.util.ArrayList<T> data
ArrSortSelection
public ArrSortSelection(java.util.Comparator<T> comp,
Traversal<T> tr)
ArrSortSelection
public ArrSortSelection(java.util.Comparator<T> comp)
initData
public void initData(Traversal<T> tr)
- Initialize the internal data set with the data generated by the
Traversal
- Specified by:
initData
in class ASortAlgo<T>
- Parameters:
tr
- the Traversal
that provides the data to sort
sort
public Traversal<T> sort()
- sort the data set with respect to the current
Comparator
- Specified by:
sort
in class ASortAlgo<T>
- Returns:
- a
AList
for the sorted data
swap
public void swap(int index1,
int index2)
findMinIndex
public int findMinIndex(int low)
main
public static void main(java.lang.String[] argv)