Which of the following is an application of stack?
Which of the following is an application of stack?
Solution
✅ Correct Option: 1
Converting an infix expression to postfix uses a stack to hold operators. An operator is pushed, and operators already on the stack with higher or equal precedence are popped to the output first. The stack's last-in-first-out (LIFO) order is what handles the precedence and bracket matching.
Options 2, 3 and 4: these are queue applications, because requests are served in the order they arrive (FIFO), not by LIFO.
Other common stack uses: undo/redo, balancing brackets, function call management (recursion) and reversing a string.
Related questions:
2026: 26 May Shift 1
2025: 27 May Shift 2
2026: 24 May Shift 1