The GATE Grind

GATE 2009 CS – Question 36

Algorithms · Searching, Sorting and Hashing · 2 marks · Multiple choice

Insert 12, 18, 13, 2, 3, 23, 5, 15 into an empty length10 hash table, using h(k)=k mod10, open addressing and linear probing. Which resultant table is correct? Entries below list indexes0 through9; “empty” denotes an empty slot.

  1. empty, empty, 2, 23, empty, 15, empty, empty, 18, empty
  2. empty, empty, 12, 13, empty, 5, empty, empty, 18, empty
  3. empty, empty, 12, 13, 2, 3, 23, 5, 18, 15
  4. empty, empty, {12, 2}, {13, 3, 23}, empty, {5, 15}, empty, empty, 18, empty

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (C) empty, empty, 12, 13, 2, 3, 23, 5, 18, 15

Explanation

We are sorry we couldn't write detailed soluition for this, we are working on it!, please consider asking your own AI, its just 2-3 clicks with very minimum effort

More Searching, Sorting and Hashing questions

All Searching, Sorting and Hashing questions →