标签:blog http os ar java for sp c on
RandomizePlace(char * Arry,int len) { int temp; for(iny i=0;i<len;i++) { index=BlockRand(i,len); temp=Arry[i]; Arry[i]=arry[index]; Arry[index]=temp; } } int BlockRand(int a,int b) { int r; r=rand()/RAND_MAX; return a+r*(b-a); }
Arry即为均匀随机排列数组。
随机排列数组满足这两个条件
[1].http://www.cnblogs.com/pangxiaodong/archive/2011/09/05/2167485.html
[2].算法导论.P66~P73
标签:blog http os ar java for sp c on
原文地址:http://my.oschina.net/lvyi/blog/324252