Quicksort is an efficient sorting algorithm based on Divide and Conquer rule. Developed in 1959, this algorithm is still a commonly used algorithm for sorting. It works by selecting a ‘pivot’ element from the array and partitioning the other elements into two sub-arrays and recursively sorting them.
There are three steps to perform Quick Sort:
One is to pick an element, called a pivot, from the array to sort.
Seconds is partition operation. In this step we reorder the array so that elements with values less than the pivot come to the left, and elements with values greater than the pivot value come to the right of the pivot.
Finally, we apply the above two steps recursively to the sub-arrays i.e. elements to the left and right of the pivot.
YouTube Video: https://youtu.be/G6aI1YJT_1A
See also: Shell Sort, Bubble Sort, Insertion Sort, Selection Sort