In quick sort, the average case time complexity is O(nlogn). In this case, we must consider the left, the location, and the right . In an array, the beg position is regarded as left=location=0. the end is regarded as right .first we have to check the array from right to left. if the right is greater than the location then right=right-1.or if the right