r/javahelp • • 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

7 comments sorted by

View all comments

1

u/lookForProject Mar 15 '20

I never build one, but my first guess/try would be: two arrays. One for key, one for value. The value is the bucket. Most simplest solution would be making bucket that's just an array.