Sequence of records(k) = 43, 63, 84, 11, 5, 72, 15 16.
Hash function , h(k) = k mod 12.
Linear probing is used in case of a collision.
Hash table-
Index |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
keys |
84 |
72 |
|
63 |
15 |
5 |
16 |
43 |
|
|
|
11 |
So, Index of the last element(16) inserted = 6.