Quick sort
Quick sort is also known as partition exchange sort. It was developed by Tony Hoare. Quick sort also utilizes the power of divide and conquer, which we came to understand in the previous section. It is just about dividing a problem into approximately similar sub problems, solving each sub problem separately, and combining the results of the sub problems to deliver the final result.
Quick sort steps can be laid out in following fashion:
- We select a pivot element. Selecting a proper pivot is very necessary for efficiency in a quick sort algorithm.
- We put the pivot element in such a location that all the elements on its left are less than the pivot element, and all the elements on its right are greater than the pivot. This way, we partition the sequence into two parts.
- Sort the subsequence on the left side of the pivot element and that on the right side of the pivot element recursively.
No worries, we will have a detailed discussion on all the steps in the following pages. Let&apos...