- 博客(3)
- 资源 (1)
- 收藏
- 关注
原创 quicksort
function partition(array, left, right, pivotIndex) pivotValue := array[pivotIndex] swap array[pivotIndex] and array[right] // Move pivot to end storeIndex := left for i from left to right - 1 // left ≤ i < rightif arr
2011-06-02 14:49:00 2449
原创 quickselect
function partition(list, left, right, pivotIndex) pivotValue := list[pivotIndex] swap list[pivotIndex] and list[right] // Move pivot to end storeIndex := left for i from left to right if list[i] < pivotValue
2011-06-02 14:45:00 3616
原创 Top K algorithm
<br />function quickfindFirstK(list, left, right, k)<br /> if right > left<br /> select pivotIndex between left and right<br /> pivotNewIndex := partition(list, left, right, pivotIndex)<br /> if pivotNewIndex > k // new
2011-06-02 14:12:00 2617
Linux101个技巧(Linux-101-Hacks)
2009-02-18
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人