Write an algorithm for Quick sorting
- Quick sort is a divide-and-conquer algorithm that sorts an array by recursively partitioning the array around a pivot element.
- The pivot element is chosen such that all elements smaller than the pivot are placed to the left of the pivot and all elements greater than the pivot are placed to the right of the pivot.
- The two subarrays are then sorted recursively.