//in linear probing public class ClosedHashing { T [] table; T tombstone; @SuppressWarnings("unchecked") public ClosedHashing(int capacity) { table = (T[]) new Object[capacity]; tombstone=(T)new Object(); } //throws IllegalStateException when full public void add(T x) { int pos=Math.abs(x.hashCode())%table.length; for(int i=0;i H2=new ClosedHashing(table.length*2);// better to use nearest_prime(table.length*2)) for(int i=0;i table=new SCHashing<>(13); table.add(new Record( 22030, "Mario")); table.add(new Record( 77840, "Peach")); table.add(new Record( 12374, "Bowser")); table.add(new Record( 43675, "Luigi")); table.add(new Record( 84146, "Toad")); //test int query=22031; System.out.println("ID="+query+" has name="+table.find(new Record(query)).name); } }