package data.BitSet;
import java.io.IOException;
import java.util.Random;
public class Data {
public static void main(String[] args)throws Exception {
test();
}
/**
* 求反交集
* @throws IOException
*/
public static void test() throws IOException {
int[] randomNums = new int[10000000];
Random random = new Random();
for (int i = 0, length = randomNums.length; i < length; i++) {
randomNums[i] = random.nextInt(10000000);
}
long start = System.currentTimeMillis();
boolean[] bitArray = new boolean[10000000];
for (int i = 0, length = randomNums.length; i < length; i++) {
bitArray[randomNums[i]] = true;
}
for (int i = 0, length = bitArray.length; i < length; i++) {
if (bitArray[i]) {
continue;
}
//System.out.println(i);
}
long end = System.currentTimeMillis();
System.out.println("Spend milliseconds: " + (end - start));
}
}