We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e14a46f commit 5beb84aCopy full SHA for 5beb84a
Selection Sampling/README.markdown
@@ -193,7 +193,7 @@ print(output.count)
193
194
The performance of this second algorithm is **O(n)** as it may require a pass through the entire input array.
195
196
-> **Note:** If `k > n/2`, then it's more efficient to do it the other way around and choose `k` items to remove.
+> **Note:** If `k > n/2`, then it's more efficient to do it the other way around and choose `a.count - k` items to remove.
197
198
Based on code from Algorithm Alley, Dr. Dobb's Magazine, October 1993.
199
0 commit comments