Shuffle elements of an array/n numbers uniformly randomly. Possibley in expected O(n) time

后端 未结 3 1362
谎友^
谎友^ 2021-01-06 17:47

Is it possible to shuffle elements of an n-sized array uniformly, i.e. the probability of any of the n! combinations occurring is the same, in expected O(n) tim

3条回答
提交回复
热议问题