 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
Then,
the algorithm to insert an item into the
|
|
|
|
linked
list:
|
|
|
|
– |
Use
the hash function to find the hash index
|
|
|
|
– |
Allocate
memory for this new item
|
|
|
|
– |
Store
the newitem in this new memory
|
|
|
|
– |
Insert
this new node between the "head" of this list
|
|
|
and
the first node in the list
|
|
|
| • |
Why
shouldn’t we traverse the chain?
|
|
|
|
– |
Think
about the order...
|
|