@@ -2,23 +2,34 @@ const { HashTable } = PacktDataStructuresAlgorithms;
22
33const hash = new HashTable ( ) ;
44
5- hash . put ( 'Gandalf' , '[email protected] ' ) ; 6- hash . put ( 'John' , '[email protected] ' ) ; 7- hash . put ( 'Tyrion' , '[email protected] ' ) ; 8- hash . put ( 'Aaron' , '[email protected] ' ) ; 9- hash . put ( 'Donnie' , '[email protected] ' ) ; 10- hash . put ( 'Ana' , '[email protected] ' ) ; 5+ console . log ( hash . hashCode ( 'Ygritte' ) + ' - Ygritte' ) ;
6+ console . log ( hash . hashCode ( 'Jonathan' ) + ' - Jonathan' ) ;
7+ console . log ( hash . hashCode ( 'Jamie' ) + ' - Jamie' ) ;
8+ console . log ( hash . hashCode ( 'Jack' ) + ' - Jack' ) ;
9+ console . log ( hash . hashCode ( 'Jasmine' ) + ' - Jasmine' ) ;
10+ console . log ( hash . hashCode ( 'Jake' ) + ' - Jake' ) ;
11+ console . log ( hash . hashCode ( 'Nathan' ) + ' - Nathan' ) ;
12+ console . log ( hash . hashCode ( 'Athelstan' ) + ' - Athelstan' ) ;
13+ console . log ( hash . hashCode ( 'Sue' ) + ' - Sue' ) ;
14+ console . log ( hash . hashCode ( 'Aethelwulf' ) + ' - Aethelwulf' ) ;
15+ console . log ( hash . hashCode ( 'Sargeras' ) + ' - Sargeras' ) ;
16+
17+ hash . put ( 'Ygritte' , '[email protected] ' ) ; 1118hash . put ( 'Jonathan' , '[email protected] ' ) ; 1219hash . put ( 'Jamie' , '[email protected] ' ) ; 13- hash . put ( 'Sue ' , 'sue @email.com' ) ;
14- hash . put ( 'Mindy ' , 'mindy @email.com' ) ;
15- hash . put ( 'Paul ' , 'paul @email.com' ) ;
20+ hash . put ( 'Jack ' , 'jack @email.com' ) ;
21+ hash . put ( 'Jasmine ' , 'jasmine @email.com' ) ;
22+ hash . put ( 'Jake ' , 'jake @email.com' ) ;
1623hash . put ( 'Nathan' , '[email protected] ' ) ; 24+ hash . put ( 'Athelstan' , '[email protected] ' ) ; 25+ hash . put ( 'Sue' , '[email protected] ' ) ; 26+ hash . put ( 'Aethelwulf' , '[email protected] ' ) ; 27+ hash . put ( 'Sargeras' , '[email protected] ' ) ; 1728
1829console . log ( '**** Printing Hash **** ' ) ;
1930
2031console . log ( hash . toString ( ) ) ;
21- // {5 => [#Sue: sue @email.com] },{10 => [#Nathan: nathan @email .com]},{13 => [#Ana: ana @email .com]},{16 => [#Aaron: aaron @email .com]},{19 => [#Gandalf: gandalf @email .com]},{29 => [#John: johnsnow @email .com]},{32 => [#Paul: paul @email .com]}
32+ // {4 => [#Ygritte: ygritte @email.com] },{5 => [#Aethelwulf: aethelwulf @email .com]},{7 => [#Athelstan: athelstan @email .com]},{8 => [#Jasmine: jasmine @email .com]},{9 => [#Jake: jake @email .com]},{10 => [#Sargeras: sargeras @email .com]}
2233
2334console . log ( '**** Get **** ' ) ;
2435
0 commit comments