public class InsertionSort extends SortAlgorithm
indexList
Constructor and Description |
---|
InsertionSort()
Create a new instance of InsertionSort
|
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList |
sort(java.lang.String valueType,
EvaluateMathDef eval,
java.util.ArrayList sortList,
boolean sortIndexes)
Run the sort over all the elements in the array.
|
getIndexList, randomise
public java.util.ArrayList sort(java.lang.String valueType, EvaluateMathDef eval, java.util.ArrayList sortList, boolean sortIndexes) throws java.lang.Exception
sort
in class SortAlgorithm
valueType
- the object type being evaluated.eval
- the evaluation function.sortList
- the array of values to sort.sortIndexes
- if true also record the new index positions from their original position.
If false do not do this, as it requires extra processing steps.java.lang.Exception
- any error.