Note the resemblenceresemblance to quicksort; indeed, just as the minimum-based selection algorithm is a partial selection sort, this is a partial quicksort, generating and partitioning only O(log ''n'') of its O(''n'') partitions. This simple procedure has expected linear performance, and, like quicksort, has quite good performance in practice. It is also an [[work-in-place|in-place]] algorithm, requiring only constant memory, since the tail recursion can be eliminated with a loop like this: