to recapthe first time the quick sort function was calledit was partitioned about the element at index after the return of the partitioning functionwe obtain the array [ as you can seeall elements to the right of element are greaterwhile those to the left are smaller the partitioning is complete using the split point with index we will recursively sort the two sub-arrays [ and [ using the same process we just went through the body of the main quick sort function is as followsdef quick_sort(unsorted_arrayfirstlast)if last first < return elsepartition_point partition(unsorted_arrayfirstlastquick_sort(unsorted_arrayfirstpartition_point- quick_sort(unsorted_arraypartition_point+ lastthe quick sort function is very simple methodno more than lines of code the heavy lifting is done by the partition function when the partition method is called it returns the partition point this is the point in the unsorted_array where all elements to the left are less than the pivot and all elements to its right are greater than it when we print the state of unsorted_array immediately after the partition progresswe see clearly how the partitioning is happeningoutput[ [ [ [ [ taking step backlet' sort the first sub array after the first partition has happened the partitioning of the [ sub array will stop when greater_than_pivot_index is at index and less_than_pivot_index is at index at that pointthe two markers are said to have crossed because greater_than_pivot_index is greater than less_than_pivot_indexfurther execution of the while loop will cease pivot will be exchanged with while index is returned as the partition point the quick sort algorithm has ( worst case complexitybut it is efficient when sorting large amounts of data