Lately,I've been going through implementations of Map
interface in java
. I understood HashMap
and everything made sense.
But when it comes to LinkedHashMap
, as per my knowledge so far, the Entry has key
, value
, before
and after
. where before and after keeps track of order of insertion.
However, using hashcode
and bucket concept doesn't make sense to me in LinkedHashMaps
.
I went through this article for understanding implementation of linkedHashMaps
Could someone please explain it? I mean why does it matter in which bucket we put the entry node. In fact why bucket concept in the first place.? why not plain doubly llinked lists?