Different versions of quicksort algorithm was implemented. Initial version is a recursive quicksort where pivot is always selected as the first element, and this version is the one named as 'QuickSort.java'. Modifications below and their combinations was applied to get the different versions of quicksort algorithm.
- Median of three method for pivot selection
- Switching to insertion sort in smaller subarrays
- Eliminating recursion
There are three types of inputs which are in ascending order, descending order. The third type is generated in such a way that the pivot divides both sides of the input array equally. Necessary lines for generating different types of inputs are in the code so you can comment out or uncomment to use the type you want.
- Import the repo.
- Change the type and the size of the input.
- Run and see the results!