Content deleted Content added
Developing recursion in the cost bound doesn't provide a real proof per se. |
(correct changes from Revision as of 03:02, 18 April 2011 |
||
Line 51:
pivotIndex := ... ''// select a pivotIndex between left and right''
pivotNewIndex := partition(list, left, right, pivotIndex)
pivotDist := pivotNewIndex
''// The pivot is in its final sorted position,''
''// so pivotDist reflects its 1-based position if list were sorted''
Line 67:
pivotIndex := ... ''// select pivotIndex between left and right''
pivotNewIndex := partition(list, left, right, pivotIndex)
pivotDist := pivotNewIndex
'''if''' pivotDist = k
'''return''' list[pivotNewIndex]
|