the preceding diagram shows the direction in which the algorithm searches for the next smallest item quick sort the quick sort algorithm falls under the divide and conquer class of algorithmswhere we break (dividea problem into smaller chunks that are much simpler to solve (conquerin this casean unsorted array is broken into sub-arrays that are partially sorteduntil all elements in the list are in the right positionby which time our unsorted list will have become sorted list partitioning before we divide the list into smaller chunkswe have to partition it this is the heart of the quick sort algorithm to partition the arraywe must first select pivot all the elements in the array will be compared with this pivot at the end of the partitioning processall elements that are less than the pivot will be to the left of the pivotwhile all elements greater than the pivot will lie to the right of the pivot in the array pivot selection for the sake of simplicitywe'll take the first element in any array as the pivot this kind of pivot selection degrades in performanceespecially when sorting an already sorted list randomly picking the middle or last element in the array as the pivot does not improve the situation any further in the next we will adopt better approach to selecting the pivot in order to help us find the smallest element in list implementation before we delve into the codelet' run through the sorting of list using the quick sort algorithm the partitioning step is very important to understand so we'll tackle that operation first