
In Computer Organization & Architecture (COA), Stack and Queue organization in memory is an important concept. ECET often asks questions on memory management, push/pop operations, circular queues, and addressing modes.
📘 Concept Notes
🔹 Stack Organization
- Stack = Linear data structure following LIFO (Last In, First Out) principle.
- In memory, stack can grow upward (low → high addresses) or downward (high → low addresses).
- Basic operations:
- Push (Insert) → Add element on top of stack.
- Pop (Delete) → Remove element from top of stack.
- Stack Pointer (SP): Register that always points to the top of stack.
Formulas:
- After Push:
(depending on upward/downward growth).
- After Pop:
.
🔹 Queue Organization
- Queue = Linear data structure following FIFO (First In, First Out) principle.
- Elements are inserted at Rear and deleted from Front.
- Types of Queues:
- Simple Queue → Linear.
- Circular Queue → Wraps around memory using modulo arithmetic.
- Double-Ended Queue (Deque) → Insert/delete from both ends.
Formula for Circular Queue:
- Rear update:
- Front update:
where = size of queue.
📐 Example – Stack in Memory
- Assume downward growing stack:
- Initial SP = 1000.
- Push 2 items → SP = 998.
- Pop 1 item → SP = 999.
📐 Example – Queue in Memory
- Queue size =
.
- Insert 3 elements → Rear = 2, Front = 0.
- Delete 1 element → Front = 1.
- Insert 2 more → Rear = 4.
- Next insert wraps → Rear = (4+1) mod 5 = 0.
🛠 Applications
- Stack: Function call management, recursion, expression evaluation.
- Queue: Process scheduling, buffering, resource management.
🔟 10 Expected MCQs – ECET 2026
Q1. Stack follows which principle?
A) FIFO
B) LIFO
C) FILO
D) None
Q2. Queue follows which principle?
A) FIFO
B) LIFO
C) FILO
D) None
Q3. In downward growing stack, after Push operation:
A) SP increases
B) SP decreases
C) SP constant
D) Depends on size
Q4. In circular queue, formula for Rear update is:
A) Rear + 1
B) (Rear + 1) mod N
C) (Rear – 1) mod N
D) None
Q5. Which pointer indicates the deletion point in a queue?
A) Top
B) Rear
C) Front
D) Stack Pointer
Q6. If stack pointer = 500 and stack grows downward, after pushing 2 elements (size=1 each), SP = ?
A) 500
B) 501
C) 498
D) 502
Q7. Which of the following is NOT a type of queue?
A) Simple
B) Double-ended
C) Circular
D) Parallel
Q8. Which data structure is used in function calls?
A) Queue
B) Stack
C) Array
D) Linked List
Q9. If queue size = 5, Rear = 4, then next insertion index = ?
A) 0
B) 5
C) 4
D) 3
Q10. Stack overflow occurs when:
A) Queue full
B) Stack full
C) Front > Rear
D) SP = 0
✅ Answer Key
Q.No | Answer |
---|---|
Q1 | B |
Q2 | A |
Q3 | B |
Q4 | B |
Q5 | C |
Q6 | C |
Q7 | D |
Q8 | B |
Q9 | A |
Q10 | B |
🧠 Explanations
- Q1 → B: Stack = LIFO.
- Q2 → A: Queue = FIFO.
- Q3 → B: Downward growing stack decreases SP on Push.
- Q4 → B: Circular queue uses modulo arithmetic.
- Q5 → C: Front shows deletion index.
- Q6 → C: 500 → 499 → 498 after 2 pushes.
- Q7 → D: Parallel queue not standard.
- Q8 → B: Function calls use stack frames.
- Q9 → A: (Rear+1) mod 5 = 0.
- Q10 → B: Stack overflow when full.
🎯 Why Practice Matters
- Questions from stack & queue organization are common in ECET.
- Easy marks if you remember formulas for SP updates and circular queue modulo rule.
- Also useful for job interviews and coding tests.