The GATE Grind

GATE 2024 DA – Question 16

Programming, Data Structures and Algorithms · Stacks, queues, linked lists, trees and hash tables · 1 mark · Multiple choice

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. (p) − (ii), (q) − (iii), (r) − (i)
  2. (p) − (ii), (q) − (i), (r) − (iii)
  3. (p) − (i), (q) − (ii), (r) − (iii)
  4. (p) − (i), (q) − (iii), (r) − (ii)

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (A) (p) − (ii), (q) − (iii), (r) − (i)

Explanation

A queue removes the oldest element first (FIFO), a stack removes the newest element first (LIFO) and a hash table is built for fast lookup. So p-ii, q-iii, r-i.