Hi i read this explanation but i want someone to clear is there an error by using word ‘linked list’ instead of hash map because we are in hash map section!!
In case of collision, it checks if the existing key in the bucket is equal to the key that we are trying to store. If yes, then the value of the key is updated. If the key is different, then it is added at the end of the existing key in the bucket to form a LinkedList.
There is one improvement made in Java 8. If the size of the LinkedList in a particular bucket becomes more than TREEIFY_THRESHOLD, then the LinkedList is converted to a red-black tree. TREEIFY_THRESHOLD is a constant with a default value of 8. This value can’t be changed as it is a final variable. This means that if the size of the Linked List becomes more than 8, then it is converted into a tree.
Course: https://www.educative.io/collection/6650775272947712/6368023997317120
Lesson: https://www.educative.io/collection/page/6650775272947712/6368023997317120/5062093120733184