Often the leftmost item is chosen as the pivot. The recursion means that the algorithm runs the same exact algorithm on the two partitions that were created by the comparisons to the pivot. Note that this algorithm will keep on partitioning the array into subarrays, and splitting those subarrays into even smaller subarrays. Each time it does this, it will choose a new pivot within the subarray and compare the items to the subarray. The base case is when the algorithm reaches a subarray with only one item, in which it just stops because one item does not need to be sorted.