// a "throw-away program" to help show that **prime-number** size hash tables // help when data keys are repeatedly separated by the same amount // (provided that amount is not a multiple of the table size) public class Lecture10 { public static void main(String[] args) { if(args.length != 4) { System.err.println("Lecture10: initial-value multiple table-size iterations"); System.exit(1); } int initial = Integer.parseInt(args[0]); int multiple = Integer.parseInt(args[1]); int tablesize = Integer.parseInt(args[2]); int iterations = Integer.parseInt(args[3]); for(int i=0; i < iterations; ++i) { int x = initial + multiple*i; System.out.println( x + " % " + tablesize + " = " + x % tablesize); } } }