public interface SortDriverInterface
| Modifier and Type | Interface and Description |
|---|---|
static class |
SortDriverInterface.ArrayType
This
enum is used to specify the type of Array. |
static class |
SortDriverInterface.SortType
This
enum is used to specify the desired sort algorithm:
BubbleSort - Indicates the Bubble Sort algorithm.
SelectionSort - Indicates the Selection Sort algorithm.
InsertionSort - Indicates the Insertion Sort algorithm.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Integer[] |
createArray(SortDriverInterface.ArrayType arrayType,
int arraySize)
This method is used to create a new array of Integer objects of the type and size
specified.
|
java.lang.Object[] |
runSort(SortDriverInterface.SortType sortType,
SortDriverInterface.ArrayType arrayType,
int arraySize,
int numberOfTimes)
This method will run the sortType for numberOfTimes.
|
java.lang.Integer[] createArray(SortDriverInterface.ArrayType arrayType, int arraySize)
arrayType - This parameter specifies the type of array to create. See the enum SortDriverInterface.ArrayType.arraySize - This parameter specifies the size of array to create.java.lang.Object[] runSort(SortDriverInterface.SortType sortType, SortDriverInterface.ArrayType arrayType, int arraySize, int numberOfTimes)
This method will run the sortType for numberOfTimes.
Create the Object array
Create instance of TestTimes class
Repeat the following numberOfTimes:
Object array
Object array
Add TestTimes instance to the Object array
Return the Object array
sortType - This parameter specifies the sort algorithm that will be used. See SortDriverInterface.SortType.arrayType - This parameter specifies the type of array to create each time the sort is run.
See the enum SortDriverInterface.ArrayType.arraySize - This parameter specifies the size of array to create each time the sort is run.numberOfTimes - This parameter specifies the number of times to run the specified sort.