Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    In the case of the first option, is there any reason a linked list is used instead of an array or even a binary search tree? Commented May 5, 2013 at 5:28
  • 1
    the above explanation is high level, I don't think it makes much difference as to linked list vs. array. I think a binary search tree would be overkill. Also I think if you dig into things like ConcurrentHashMap and others there any many low level implement details that can make a performance difference, that the high level explanation above does not account for. Commented May 6, 2013 at 14:11
  • 6
    If chaining is used, when given a key, how do we know which item to get back? Commented Oct 10, 2015 at 4:04
  • 2
    @ChaoSXDemon you can traverse the list in the chain by key, duplicate keys are not the issue the issue is two different keys having the same has hashcode. Commented Oct 12, 2015 at 1:32
  • 1
    @ams : Which one is preferred ? is There any limit for Hash collision, after which 2nd point is executed by JAVA ? Commented Nov 17, 2017 at 12:42