Lab 6
Quick Sort Part I
(Not Generic)
Objective
Implement the quicksort algorithm using Java.
Description

Create a class QuickSorter.java that implements the quicksort algorithm over arrays of Integers (later on we will use generic lists). You may use this file as a template. Your goal is twofold:

Hint

You may use the following algorithm for your partition method:

Function Partition(array, start, end)
pivotI ← GetPivotI(start, end)
pivotarray[pivotI]
Swap(end, pivotI) // Move pivot to the end
largestart
For index from start upto end
If array[index] > pivot
Swap(index, large)
largelarge + 1
EndIf
EndFor
Swap(large, end)
Return large // Return the index of the pivot
EndFunction

After you have completed the above, you should experiment with the `getPivotIndex' method to see how this affects the time of the algorithm. Here are some ideas to try:

Be careful not to introduce potential ArrayIndexOutOfBoundsExceptions

Finally:

Upload the .java file to the dropbox