3 ms·
> You shouldn't be expected to know Floyd's algorithm [1]. Bob Floyd had more than one algorithm named after him. I thought you were referring to his beautifu
by tmoertel 13y ago
> You shouldn't be expected to know Floyd's algorithm [1].
Bob Floyd had more than one algorithm named after him. I thought you were referring to his beautiful algorithm for sampling without replacement [1], described by Jon Bentley in his CACM "Programming Pearls" column in 1987 [2]. If you don't know that one, it's worth studying for the techniques it reveals.
[1] http://math.stackexchange.com/questions/178690/whats-the-proof-of-correctness-for-robert-floyds-algorithm-for-selecting-a-sin http://math.stackexchange.com/questions/178690/whats-the-pro...
[2] http://dl.acm.org/citation.cfm?id=315746&dl=ACM&coll=DL&CFID=330377838&CFTOKEN=93208025 http://dl.acm.org/citation.cfm?id=315746&dl=ACM&coll=DL&CFID...