How is a hash value calculated using the remainder method?
How is a hash value calculated using the remainder method?
Solution
✅ Correct Option: 2
The remainder (division) method divides the element by the size of the hash table and uses the remainder as the index. This keeps every hash value between and , so it always fits in the table.
For example, with a table of size , the element gives .
Options 1 and 3: division gives the quotient, not the remainder. This is a common mix-up between "/" or "//" and "%".
Option 4: multiplying makes the value larger and can go beyond the table, so it is not a valid index.
Related questions:
2025: 30 May Shift 2
2026: 18 May Shift 2
2025: 15 May Shift 2
2026: 23 May Shift 1
2026: 29 May Shift 2