比如有条件, 三位以上数字重复出现十次则判为不随机,如何解决?
如果每n位hash一次的运算量非常大啊,
public boolean RandomCheck(int[] list)
{
HashMap map = new HashMap();
int interval = 4;
int j = 0;
while(interval<=list.length/10)
{
for(int i = 0;i{
j = i;
while(j+interval{
String pattern = HashFunc(n, j, interval);
if(!map.containsKey(pattern))
{
map.put(pattern, 1);
}
else
{
if(map.get(pattern)>=9)
{
return false;
}
map.put(pattern, map.get(pattern)+1);
}
j+=interval;
}
}
interval++;
}
return true;
}