|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Sort
A class to give a comaprative view of common sorting algorithms. The maintains a private static variable that counts the number of array assignments that are performed (as an approximate measure of the complexity of the algorithm.
| Method Summary | |
|---|---|
int |
getCount()
Returns the number of array assignment operations performed by this class since the count variable was rest. |
void |
insertionSort(long[] a)
Executes the insertion sort algorithm sorting the argument array. |
void |
mergeSort(long[] a)
Executes the merge sort algorithm sorting the argument array. |
void |
quickSort(long[] a)
Executes the quicksort algorithm sorting the argument array. |
void |
reset()
Resets the counter variable to 0 |
| Method Detail |
|---|
int getCount()
void reset()
void insertionSort(long[] a)
a - the array of long integers to be sortedvoid mergeSort(long[] a)
a - the array of long integers to be sortedvoid quickSort(long[] a)
a - the array of long integers to be sorted
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||