Sample code for a few of the different sorting algorithms, written in Java.
Clone this github project locally and run src/algorithm/AlgorithmTest.java.
This project will create a random array of integers, which you can then call a function on to try each of the sorting algorithms.
In the main method, simply uncomment (and comment out the other calls) the call to the method you wish to run.
To change the length of the array, simply change the variable arrayLength.
Algorithms currently included:
- Selection Sort
- Insertion Sort
- Merge Sort
- Deterministic Quick Sort
- Randomized Quick Sort
- Counting Sort
- Potentially add timesort