java - Is hashMap implemented as an array of linked lists -
while reading hashmap
see implemented array of buckets? these buckets linked lists? if so, why called buckets , not linked lists?
looking @ source code of hashmap
tells it's implemented array of entries:
transient entry[] table;
each entry has field next
, create single linked list structure:
static class entry<k,v> implements map.entry<k,v> { final k key; v value; entry<k,v> next;
"bucket" higher-level term, using in literature , when explaining hash maps. here "buckets" implemented single linked lists.
Comments
Post a Comment