/* java MakeSortData 200000 0 100000 256 0 >sdata1.txt // random java MakeSortData 200000 0 100000 256 1 >sdata2.txt // increasing order java MakeSortData 200000 0 100000 256 2 >sdata3.txt // decreasing order */ import java.util.*; import java.io.*; public class MakeSortData { public static void main(String[] args) { // size minNum maxNum seed int size = 100000; int minNum = 0; int maxNum = 10000; int seed = 256; int order=0; // 0: random, 1:increase, 2:decrease order if (args.length > 0) size = Integer.parseInt(args[0]); if (args.length > 1) minNum = Integer.parseInt(args[1]); if (args.length > 2) maxNum = Integer.parseInt(args[2]); if (args.length > 3) seed = Integer.parseInt(args[3]); if (args.length > 4) order = Integer.parseInt(args[4]); Random random = new Random(seed); int n = maxNum - minNum; int[] a = new int[size]; for (int i=0; ia[j])) k = j; } int tmp = a[i]; a[i] = a[k]; a[k] = tmp; } */ } public static void rev(int[] a) { for (int i=0; i