GateAI
Searching, Sorting and Hashing

GATE CSE 2026 Set 1 · Q24

MSQ1 markEasy

Time

Consider a hash table P[0,1,…,10]P[0, 1, \dots, 10] that is initially empty. The hash table is maintained using open addressing with linear probing. The hash function used is h(x)=(x+7) mod 11h(x) = (x + 7) \bmod 11. Consider the following sequence of insertions performed on PP: 1,13,22,15,11,241, 13, 22, 15, 11, 24 Which of the following positions in the hash table is/are empty after these insertions are performed?

Select all that applyOne or more correct

Pick every correct option

Solution

Step-by-step verified solution

Official answer: C) 2

Searching, Sorting and Hashing

The hash table has 1111 slots indexed from 00 to 1010. The hash function is:

h(x)=(x+7) mod 11h(x) = (x + 7) \bmod 11

Let us trace the insertions step by step:

  1. Insert 1:

    h(1)=(1+7) mod 11=8h(1) = (1 + 7) \bmod 11 = 8

    Slot 88 is empty   ⟹  P[8]=1\implies P[8] = 1.

  2. Insert 13:

    h(13)=(13+7) mod 11=20 mod 11=9h(13) = (13 + 7) \bmod 11 = 20 \bmod 11 = 9

    Slot 99 is empty   ⟹  P[9]=13\implies P[9] = 13.

  3. Insert 22:

    h(22)=(22+7) mod 11=29 mod 11=7h(22) = (22 + 7) \bmod 11 = 29 \bmod 11 = 7

    Slot 77 is empty   ⟹  P[7]=22\implies P[7] = 22.

  4. Insert 15:

    h(15)=(15+7) mod 11=22 mod 11=0h(15) = (15 + 7) \bmod 11 = 22 \bmod 11 = 0

    Slot 00 is empty   ⟹  P[0]=15\implies P[0] = 15.

  5. Insert 11:

    h(11)=(11+7) mod 11=18 mod 11=7h(11) = (11 + 7) \bmod 11 = 18 \bmod 11 = 7
    • Slot 77 is occupied (2222).

    • Slot 88 is occupied (11).

    • Slot 99 is occupied (1313).

    • Slot 1010 is empty   ⟹  P[10]=11\implies P[10] = 11.

  6. Insert 24:

    h(24)=(24+7) mod 11=31 mod 11=9h(24) = (24 + 7) \bmod 11 = 31 \bmod 11 = 9
    • Slot 99 is occupied (1313).

    • Slot 1010 is occupied (1111).

    • Slot 00 is occupied (1515).

    • Slot 11 is empty   ⟹  P[1]=24\implies P[1] = 24.

After all insertions, the occupied positions are:

  • Position 00: 1515

  • Position 11: 2424

  • Position 77: 2222

  • Position 88: 11

  • Position 99: 1313

  • Position 1010: 1111

The empty positions are 2,3,4,5,2, 3, 4, 5, and 66.

Among the given options, only position 2 (Option C) is empty.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Searching, Sorting and Hashing previous year question is Q24 of the GATE CSE 2026 Set 1 paper. Find more GATE CSE PYQs on Searching, Sorting and Hashing in Algorithms, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Searching, Sorting and Hashing PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Searching, Sorting and Hashing in GATE CSE

Searching, Sorting and Hashing has 27 GATE CSE PYQs across 20 papers from 2012 to 2026. This is the only 1-mark MSQ among them, and it is the only one in GATE CSE 2026 Set 1.

How GATE tests Searching, Sorting and Hashing

More from GATE CSE 2026 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2026 Set 1 · Q24 · MSQ

Consider a hash table P[0, 1, , 10] that is initially empty. The hash table is maintained using open addressing with linear probing. The hash function used is h(x) = (x + 7) mod 11. Consider the following sequence of insertions performed on P: 1, 13, 22, 15, 11, 24 Which of the following positions in the hash table is/are empty after these insertions are performed?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.