Need help with adding elements to hashtable with linear probing Here is an example problem which I have having trouble figuring out. The red text is the answer.



I get how the values are added before the hashtable is resized... that is common sense. (Insert 0 at index 3, 5 at index 1, etc.)

But when the table is resized, each element has a new position. HOW is 1's new index 0? HOW is 5's new index 7? How did each element of the array get assigned their new index upon table resize?

Any help would be appreciated.

Thanks
It's not explicitly defined - rather there's an implicit subindex (based off the table's size) to the hash-function. At the start we had e.g., $h(0) = h_7(0) = 3$. They are then informing you that $h_14(0) = 8$. There is no explained reason for this. They then re-insert the data to the larger hash table going over the old data in the order it appears in the hash table.