The basic algorithm. Every item of the partition is equal to p and is therefore sorted. The problem is clearly apparent when all the input elements are equal: at each recursion, the left partition is empty (no input values are less than the pivot), and the right partition has only decreased by one element (the pivot is removed). < Running time is an important thing to consider when selecting a sorting algorithm since efficiency is often thought of in terms of speed. Quicksort is a comparison sort, meaning that it can sort items of any type for which a "less-than" relation (formally, a total order) is defined. [17] When the indices meet, the algorithm stops and returns the final index. ( j comparisons (close to the information theoretic lower bound) and ] Fix i and j