What is Quick Sort Algorithm?
Quick sort is one of the sorting algorithms that works on the idea of divide and conquer. It takes an element as a pivot and partitions the given array around that pivot by placing it in the correct position in the sorted array. The pivot element can be selected in the following ways:
- Select the First element as a pivot
- Select the Last element as a pivot
- Select the Middle element as a pivot
- Select a Random element as a pivot
We will use the Last element as a pivot for this article.