Which of the following is NOT an application of the queue data structure?
Which of the following is NOT an application of the queue data structure?
Solution
Recursion is handled by the call stack, which is a stack (LIFO) structure. Each recursive call is pushed onto the stack and popped when it returns, so the most recent call finishes first. A queue is FIFO, so it is not used for recursion.
Options 1, 2 and 3: all serve requests in the order they arrive (first come, first served), which is exactly how a queue works. Print jobs, processes in the ready queue and incoming calls all wait in a queue.
Memory trick: undo, backtracking, recursion and bracket matching use a stack; scheduling, buffering and BFS use a queue.
Related questions:
2026: 29 May Shift 1
2026: 19 May Shift 1
2026: 21 May Shift 1
2026: 20 May Shift 1
2025: 16 May Shift 1