GATE DA 2024 | Question 16

MCQ · 1 mark · −0.33

Match the items in Column 1 with the items in Column 2 in the following table:

Column 1Column 2
(p) First In First Out(i) Stacks
(q) Lookup Operation(ii) Queues
(r) Last In First Out(iii) Hash Tables
  1. Option A: (p) − (ii), (q) − (iii), (r) − (i) (correct)
  2. Option B: (p) − (ii), (q) − (i), (r) − (iii)
  3. Option C: (p) − (i), (q) − (ii), (r) − (iii)
  4. Option D: (p) − (i), (q) − (iii), (r) − (ii)

Answer

(A)

Explanation

Each phrase in Column 1 is the defining behaviour of one structure:

  • (p) First In First Out: a queue removes items in the order they arrived, like a line at a counter, so (p) − (ii).
  • (q) Lookup: a hash table exists to find a value by its key in expected constant time, so (q) − (iii).
  • (r) Last In First Out: a stack always removes the most recently added item, like a pile of plates, so (r) − (i).

Only option (A) has all three pairs; (C) and (D) pair FIFO with stacks, and (B) pairs lookup with stacks.

Answer: A