r/javahelp • u/Correct_Classroom • Mar 15 '20
Hashmap
What is the simplest hashmap you can code? I'm thinking of an int[] array with linkedlist at each index? Is there any other way? also please provide code, I'm stuggling to code one perfectly?
0
Upvotes
1
u/BS_in_BS Extreme Concrete Code Factorylet Mar 15 '20
The simplest you can code is to use a single array, and use the next free space in the table to store an item on collision. Note this make deleting items tricky.