Skip to main contentSkip to solution

Which technique is used to search the key in a list using remainder method?

Solution

✅ Correct Option: 4

Hashing finds the position of a key directly by applying a hash function to it. In the remainder (division) method, the key is divided by the size of the list and the remainder is used as the index, so h(key)=key mod sizeh(\text{key}) = \text{key} \bmod \text{size}. The key is then searched for at that index, without scanning the whole list.

For example, with a list of size 1010, the key 2525 goes to index 25 mod 10=525 \bmod 10 = 5.


Option 1: mid-point search is binary search, which repeatedly compares the key with the middle element of a sorted list. It does not use remainders.

Option 2: linear search checks elements one by one from the start, with no calculation of position.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question