Quick-sort
Get to know about the Quick-sort algorithm and how it uses recursion to sort elements.
We'll cover the following
Quick-sort algorithm and its partitioning technique
Quick-sort is another recursive sorting algorithm, discovered by Tony Hoare in 1959 and first published in 1961. In this algorithm, the hard part is splitting the array into smaller subarrays before recursion so that merging the sorted subarrays is trivial. It follows these steps:
- Choose a pivot element from the array.
- Partition the array into three subarrays respectively containing the elements smaller than the pivot, the pivot element itself, and the elements larger than the pivot.
- Recursively quick-sort the first and last subarrays.
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy