Assume in the following hash table that we have pointers into the beginning as well as to the end of each linked list.
Use separate chaining to operate the hash table:
- add - insert the given new key at the end of the linked list
- remove - remove the key
- search - search the key
Use can see the first item only (i.e., Current key) in the queue of items/operations. Click the table and linked list positions in order to show how the operation is performed. For some operations, you need to click many times.
Hint! In worst case, a search operation might fail, thus requiring to visit each linked list node up to the empty node at the end. However, insertions don't need to search the whole linked list as there is also a pointer to the end of the linked list.
The nodes visited during a search are colored green.