Kingle
你所有不曾料想过的问题,都会随着时间的推移而与你不期而遇
摘要: Fisher–Yates shuffle 基本思想(Knuth shuffle ):To shuffle an array a of n elements (indices 0..n-1): for i from n − 1 downto 1 do j ← random integer with 0 ≤ j ≤ i exchange a[j] and a[i]JDK源代码如下:/** * Moves every element of the List to a random new position in the list. * * @par... 阅读全文
posted @ 2012-03-07 16:51 Kingle 阅读(1642) 评论(0) 推荐(0) 编辑