-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHashMain.java
More file actions
41 lines (33 loc) · 862 Bytes
/
HashMain.java
File metadata and controls
41 lines (33 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package algodat_hw6;
public class HashMain {
public static void main(String[] args) {
// TODO Auto-generated method stub
HashMap HM = new HashMap();
System.out.println("Not compressed:");
System.out.println(HM.hashMap("Boot"));
System.out.println(HM.hashMap("Boat"));
System.out.println(HM.hashMap("Tom"));
System.out.println(HM.hashMap("Neurology"));
System.out.println("Compressed:");
System.out.println(HM.compressHash(HM.hashMap("Boot")));
System.out.println(HM.compressHash(HM.hashMap("Boat")));
System.out.println(HM.compressHash(HM.hashMap("Tom")));
System.out.println(HM.compressHash(HM.hashMap("Neurology")));
// I dont have any collisions
// load factor of 4 / N
System.out.println(4 / 101319);
}
}
/* Output:
Not compressed:
2280020
2279572
89677
724048543
Compressed:
51002
50554
89677
22969
0
*/