PadhaikoAll subjects

Past exam question: 2066 Bhadra (Regular / Back), Q1(b)

Data Structure and Algorithms · 1 marks

Open in the Padhaiko app

Topic: Definition of stack and its operations · Array implementation of…

Question

and write applications of stacks.

Solution

Core Applications of Stacks:

  1. Expression Conversion & Evaluation: Infix-to-postfix/prefix conversion and postfix evaluation.
  2. Function Calls & Recursion: Storing activation records and return addresses on the system call stack.
  3. Balanced Parenthesis & Syntax Checking: Matching { }, [ ], ( ) in compilers.
  4. Undo/Redo & Backtracking: Browser history, editor undo, and Depth-First Search (DFS).
Answer:

Stacks are used in expression conversion/evaluation, recursion/function call frames, parenthesis matching, undo/redo buffers, and DFS/backtracking.

All past exam questions for Data Structure and Algorithms