3 ms·
Yep. I encountered the problem of shuffling while writing QBASIC code as a teenager. I couldn't prove that random swapping wasn't uniform, in those days, but wa
by SamReidHughes 8y ago
Yep. I encountered the problem of shuffling while writing QBASIC code as a teenager. I couldn't prove that random swapping wasn't uniform, in those days, but was able to come up with the uniform algorithm everybody uses now and feel comfortable with its correctness.
Granted, the interview question is pretty bad if it's just a test of if you've seen the problem already.