GATE CS 2026 Set 1 | Question 24

Programming & Data Structures › Advanced Concepts · MSQ · 1 mark · Answer: C

  1. Question 24Programming & Data Structuresmsq1 mark
    Consider a hash table that is initially empty. The hash table is maintained using open addressing with linear probing. The hash function used is . Consider the following sequence of insertions performed on : 1, 13, 22, 15, 11, 24 Which of the following positions in the hash table is/are empty after these insertions are performed?
    • A.
      0
    • B.
      10
    • C.
      2
      ✓
    • D.
      1

    Answer: C

    Solution

    Answer: C (position 2 only)
    Key | h(x) = (x+7) mod 11 | Probes               | Slot
    ----+---------------------+----------------------+-----
    1   | 8                   | –                    | 8
    13  | 9                   | –                    | 9
    22  | 7                   | –                    | 7
    15  | 0                   | –                    | 0
    11  | 7                   | 7 ✗ → 8 ✗ → 9 ✗ → 10 | 10
    24  | 9                   | 9 ✗ → 10 ✗ → 0 ✗ → 1 | 1
    Among the options only 2 is empty. The trap is the wrap-around from 10 back to 0 when placing 24.
    GATE CS 2026 Set 1 Question 24 solution figure

More GATE PYQ on Advanced Concepts

All GATE CS Programming & Data Structures PYQ →

Attempt GATE CS 2026 Set 1 in real GATE exam mode

Full paper with a timer, the GATE interface and a topic-wise analysis — free.

Create free account →