Thank you so much for your feedback. Let me explain it for you. Before putting any record in the Linked hash map, the hash value of the provided key for the same record is calculated, and this is where the placement of this particular record is decided as indicated by the provided array of size 16 in the same lesson.
Now, let’s talk about the query, even though, record A and C belong to the same bucket, it doesn’t mean that there must be a connection link between them, it strictly depends on the insertion order. If record C has been inserted after record B then only the after pointer of B will point to the record C and before pointer of record C will point to the record B.
Important to note:
Each entry/node has two links that are before and after, so this data structure can’t manage to have more than two edges. The purpose of the doubly linked list in the hash map is to preserve the insertion order and iterate over them later in the same order, not to connect each node in the same bucket/hash.
Hope that clarifies the confusion.