1 Matching Annotations
- Nov 2017
-
www.wikiwand.com www.wikiwand.com
-
// The search space within the array is changing for each round - but the list // is still the same size. Thus, k does not need to be updated with each round.
If you do not do this you will have to keep moving the kth index every time respective of the size of the array.
if (pivotIdx < k - 1): quickSelect(A, pivotIdx + 1, end, k-1 - (pivotIdx + 1)); if (pivotIdx > k - 1): quickSelect(A, start, pivotIdx - 1, k - 1);
Tags
Annotators
URL
-