Challenge: Implement Quicksort
The quickSort
function should recursively sort the subarray
If the subarray has size
or , then it's already sorted, and so nothing needs to be done. Otherwise,
quickSort
uses divide-and-conquer to sort the subarray.
The divide step should partition the array, the conquer step should recursively quicksort the partitioned subarrays, and the combine step should do nothing.
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy