stresstests.algorithms
Class ArrSortInsertion<T>
java.lang.Object
stresstests.algorithms.ASortAlgo<T>
stresstests.algorithms.ArrSortInsertion<T>
public class ArrSortInsertion<T>
- extends ASortAlgo<T>
ArrSortInsertion 22 March 2007
A class to represent one sorting algorithm
- Author:
- Viera K. Proulx
Field Summary |
java.util.ArrayList<T> |
data
data that will be sorted -- mutating sort |
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
- data that will be sorted -- mutating sort
ArrSortInsertion
public ArrSortInsertion(java.util.Comparator<T> comp,
Traversal<T> tr)
ArrSortInsertion
public ArrSortInsertion(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
insertionSortArr
public void insertionSortArr()
insert
public void insert(int index)
main
public static void main(java.lang.String[] argv)