I have watched several videos as this one, but could not understand how the index value is generated.
There is a formula as index = hash & (n-1) but it is not mentioned what the "n" is?. So, could you please explain how that index value is generated?
>Solution :
The hash is generated based on the key and you need to compute the corresponding index in the array. That index is limited to the size of the array.
This part: & (n-1) will guarantee that the index value is within 0 <= index <= (n-1) by using a bitwise AND operator.