partitioning begins by locating two position markers let' call them left_mark and right_mark at the beginning and end of the remaining items in the list (positions and in figure the goal of the partition process is to move items that are on the wrong side with respect to the pivot value while also converging on the split point figure shows this process as we locate the position of we begin by incrementing left_mark until we locate value that is greater than the pivot value we then decrement right_mark until we find value that is less than the pivot value at this point we have discovered two items that are out of place with respect to the eventual split point for our examplethis occurs at and now we can exchange these two items and then repeat the process again at the point where right_mark becomes less than left_markwe stop the position of right_mark is now the split point the pivot value can be exchanged with the contents of the split point and the pivot value is now in place (figure in additionall the items to the left of the split point are less than the pivot valueand all the items to the right of the split point are greater than the pivot value the list can now be divided at the split point and the quick sort can be invoked recursively on the two halves the quick_sort function shown below invokes recursive functionquick_sort_helper quick_sort_helper begins with the same base case as the merge sort if the length of the list is less than or equal to oneit is already sorted if it is greaterthen it can be partitioned and recursively sorted the partition function implements the process described earlier def quick_sort(a_list)quick_sort_helper(a_list len(a_list def quick_sort_helper(a_listfirstlast)if first lastsplit_point partition(a_listfirstlastquick_sort_helper(a_listfirstsplit_point quick_sort_helper(a_listsplit_point lastdef partition(a_listfirstlast)pivot_value a_list[firstleft_mark first right_mark last done false while not donewhile left_mark <right_mark and a_list[left_mark<pivot_valueleft_mark left_mark while a_list[right_mark>pivot_value and right_mark >left_mark sorting and searching