-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy path08-UsingHashCollisionLinearProbing.js
37 lines (29 loc) · 1.27 KB
/
08-UsingHashCollisionLinearProbing.js
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
var hashLinearProbing = new HashLinearProbing();
hashLinearProbing.put('Gandalf', 'gandalf@email.com');
hashLinearProbing.put('John', 'johnsnow@email.com');
hashLinearProbing.put('Tyrion', 'tyrion@email.com');
hashLinearProbing.put('Aaron', 'aaron@email.com');
hashLinearProbing.put('Donnie', 'donnie@email.com');
hashLinearProbing.put('Ana', 'ana@email.com');
hashLinearProbing.put('Jonathan', 'jonathan@email.com');
hashLinearProbing.put('Jamie', 'jamie@email.com');
hashLinearProbing.put('Sue', 'sue@email.com');
hashLinearProbing.put('Mindy', 'mindy@email.com');
hashLinearProbing.put('Paul', 'paul@email.com');
hashLinearProbing.put('Nathan', 'nathan@email.com');
console.log('**** Printing Hash **** ');
hashLinearProbing.print();
console.log('**** Get **** ');
console.log(hashLinearProbing.get('Nathan'));
console.log(hashLinearProbing.get('Loiane'));
console.log('**** Remove **** ');
hashLinearProbing.remove('Gandalf');
console.log(hashLinearProbing.get('Gandalf'));
hashLinearProbing.print();
console.log('**** Remove Test 2 **** ');
console.log('Removing Jonathan', hashLinearProbing.remove('Jonathan'));
console.log('**** Print **** ');
hashLinearProbing.print();
console.log('Get Jamie', hashLinearProbing.get('Jamie'));
console.log('**** Print **** ');
hashLinearProbing.print();