日期:2014-05-19 浏览次数:20699 次
Random rand = new Random(); PriorityQueue<Integer> P = new PriorityQueue<Integer>(); for(int i = 0,num = rand.nextInt(); (i < 100 && P.add(num)) || (i < 100000000 && (P.peek() < num && P.add(num) && P.remove() != null || 1==1)); i++,num = rand.nextInt()); //System.out.println(P);