Suppose, there are 3 elements in the LHM, to be added. A,B,C. be their keys and lets ignore values. Now assume A is added to bucket 2 all the mapping is done.
B is added to bucket 3.
- A’s after is B, before is null. B’s before is A, after is null.
C is added to bucket 2.
- B’s after is C, before is A. C’s before is B, after is null.
But where is the link/node that suggests it belongs to bucket 2?
I guess there’s link missing between A and C which belong to same bucket.
Type your question above this line.
Course: https://www.educative.io/collection/6650775272947712/6368023997317120
Lesson: https://www.educative.io/collection/page/6650775272947712/6368023997317120/5844275779076096