
In ECET 2026 Computer Science, Stack is a very important data structure. Questions are frequently asked from operations (PUSH & POP) and applications. Mastering this topic ensures at least 2–3 marks in the exam.
⚙️ Concept Notes – Stack
- Definition: A stack is a linear data structure which follows LIFO (Last In, First Out) principle.
- Analogy: Like a stack of plates – the last plate placed on the top is the first one removed.
- Basic Operations:
- PUSH → Insert element into stack (on top).
- POP → Remove element from stack (from top).
- PEEK / TOP → View the top element without removing.
👉 Representation:
- Can be implemented using arrays or linked lists.
🔢 Operations with Examples
1️⃣ PUSH Operation
- Adds an element to the top of stack.
- If stack is full → Stack Overflow.
Example:
Initial Stack: [10, 20, 30] (top = 30)
PUSH(40) → [10, 20, 30, 40] (top = 40)
2️⃣ POP Operation
- Removes element from the top of stack.
- If stack is empty → Stack Underflow.
Example:
Stack: [10, 20, 30, 40] (top = 40)
POP() → removes 40 → [10, 20, 30] (top = 30)
🛠️ Applications of Stack
- Expression Conversion:
- Infix → Postfix, Prefix → Infix conversions.
- Example:
(A + B) * C
→AB + C *
(Postfix).
- Expression Evaluation:
- Postfix expressions are evaluated using stack.
- Example: Postfix:
23*54*+
→ Result = 26.
- Function Call Management:
- Recursion uses stack for maintaining function calls.
- Undo / Redo in Editors:
- Operations are stored in stack.
- Backtracking:
- Used in puzzles like maze solving, N-Queens problem.
- Parenthesis Matching:
- To check balanced brackets
{ [ ( ) ] }
.
- To check balanced brackets
⚙️ Formulas (for Array Implementation of Stack)
- PUSH (item):
- POP():
10 Most Expected MCQs – ECET 2026
Q1. A stack works on which principle?
A) FIFO
B) LIFO
C) Priority
D) Random
Q2. PUSH operation is performed on:
A) Bottom of stack
B) Top of stack
C) Middle of stack
D) None
Q3. When stack is full, it is called:
A) Underflow
B) Overflow
C) Exhaustion
D) Termination
Q4. When stack is empty and POP is performed, it is:
A) Overflow
B) Underflow
C) Both
D) None
Q5. Which of the following is not an application of stack?
A) Expression evaluation
B) Recursion
C) Parenthesis checking
D) Sorting using Merge Sort
Q6. Infix expression (A + B) * C
in postfix is:
A) ABC*+
B) AB+C*
C) AB*C+
D) A+BC*
Q7. Which of the following uses stack?
A) Undo in editor
B) Function calls
C) Balancing brackets
D) All of these
Q8. The maximum number of elements in stack depends on:
A) Size of array
B) Number of functions
C) Compiler
D) Recursion depth only
Q9. Time complexity of PUSH and POP is:
A) O(n)
B) O(1)
C) O(log n)
D) O(n log n)
Q10. In array implementation of stack, initial value of TOP is:
A) 0
B) -1
C) 1
D) NULL
✅ Answer Key
Q.No | Answer |
---|---|
Q1 | B |
Q2 | B |
Q3 | B |
Q4 | B |
Q5 | D |
Q6 | B |
Q7 | D |
Q8 | A |
Q9 | B |
Q10 | B |
🧠 Explanations
- Q1 → B: Stack follows LIFO principle.
- Q2 → B: Elements are added at the top.
- Q3 → B: Full stack → Overflow.
- Q4 → B: Empty stack + POP → Underflow.
- Q5 → D: Merge Sort uses divide-and-conquer, not stack.
- Q6 → B:
(A+B)*C
→AB+C*
. - Q7 → D: Undo, recursion, balancing brackets all use stack.
- Q8 → A: Array size limits stack capacity.
- Q9 → B: Both PUSH and POP are O(1).
- Q10 → B: Initially, TOP = -1 (empty stack).
🎯 Why This Practice Matters
Stack is a core topic in Data Structures. In ECET exams:
- 2–3 MCQs are usually asked on stack.
- Covers both theory + implementation.
- Also important for coding interviews.
By practicing operations and applications, you’ll score guaranteed marks.
📲 Join Our ECET Prep Community
👉 For daily ECET DS notes, solved MCQs, and practice questions:
Join Telegram @LearnNewThingsHub