Data Structures and Algorithms •
MCQ • Stacks and Queues
Most Important 30 Objective Question - Stacks and Queues
Q1. Stack follows which principle?
A) FIFO
B) LIFO
C) LILO
D) FILO
Answer: B
Explanation: Stack works on the LIFO (Last In First Out) principle. The last inserted element is removed first.
Q2. Queue follows which principle?
A) LIFO
B) FIFO
C) FILO
D) LILO
Answer: B
Explanation: Queue works on the FIFO (First In First Out) principle. The first inserted element is removed first.
Q3. In stack, insertion operation is called:
A) Pop
B) Push
C) Insert
D) Add
Answer: B
Explanation: Push operation is used to insert an element into the stack.
Q4. In stack, deletion operation is called:
A) Pop
B) Push
C) Delete
D) Remove
Answer: A
Explanation: Pop operation removes the topmost element from the stack.
Q5. The topmost element of stack can be accessed using:
A) Rear
B) Front
C) Peek
D) Delete
Answer: C
Explanation: Peek operation returns the top element without removing it.
Q6. Overflow condition in stack occurs when:
A) Stack is empty
B) Stack is full
C) Stack has one element
D) Stack is sorted
Answer: B
Explanation: Overflow occurs when an insertion is attempted in a full stack.
Q7. Underflow condition in stack occurs when:
A) Stack is full
B) Stack is empty
C) Stack has many elements
D) Stack is circular
Answer: B
Explanation: Underflow occurs when deletion is attempted from an empty stack.
Q8. Which of the following is an application of stack?
A) CPU Scheduling
B) Expression Evaluation
C) Printer Queue
D) Graph Coloring
Answer: B
Explanation: Stack is widely used in expression conversion and expression evaluation.
Q9. Which data structure is used for function calls in recursion?
A) Queue
B) Tree
C) Stack
D) Graph
Answer: C
Explanation: Recursive function calls are managed using the call stack.
Q10. In queue, insertion is done at:
A) Front
B) Rear
C) Middle
D) Top
Answer: B
Explanation: New elements are inserted at the rear end of the queue.
Q11. In queue, deletion is done from:
A) Rear
B) Front
C) Top
D) Middle
Answer: B
Explanation: Elements are removed from the front end in a queue.
Q12. Which queue allows insertion and deletion from both ends?
A) Circular Queue
B) Priority Queue
C) Deque
D) Simple Queue
Answer: C
Explanation: Deque (Double Ended Queue) supports insertion and deletion at both ends.
Q13. In circular queue, the last position is connected to:
A) Middle
B) Front
C) First position
D) Rear only
Answer: C
Explanation: Circular queue connects the last position back to the first position.
Q14. Priority Queue deletes element based on:
A) FIFO
B) LIFO
C) Priority
D) Random order
Answer: C
Explanation: In priority queue, elements are removed according to their priority.
Q15. Which of the following is not a type of queue?
A) Simple Queue
B) Circular Queue
C) Priority Queue
D) Binary Queue
Answer: D
Explanation: Binary Queue is not a standard type of queue.
Q16. Stack can be implemented using:
A) Array only
B) Linked List only
C) Both Array and Linked List
D) Tree only
Answer: C
Explanation: Stack can be implemented using both arrays and linked lists.
Q17. Queue can be implemented using:
A) Array only
B) Linked List only
C) Both Array and Linked List
D) Graph only
Answer: C
Explanation: Queue can also be implemented using arrays and linked lists.
Q18. Which pointer indicates the top of stack?
A) Front
B) Rear
C) Top
D) Head
Answer: C
Explanation: The top pointer indicates the current topmost element in the stack.
Q19. Which pointers are used in queue?
A) Top only
B) Front and Rear
C) Head only
D) Tail only
Answer: B
Explanation: Queue uses front for deletion and rear for insertion.
Q20. Which queue is best for CPU scheduling?
A) Simple Queue
B) Circular Queue
C) Priority Queue
D) Deque
Answer: C
Explanation: CPU scheduling often uses priority queue to execute important tasks first.
Q21. Expression conversion includes:
A) Infix to Postfix
B) Infix to Prefix
C) Prefix to Infix
D) All of these
Answer: D
Explanation: Stack is used for all types of expression conversions.
Q22. Parentheses matching uses:
A) Queue
B) Stack
C) Tree
D) Graph
Answer: B
Explanation: Stack is commonly used to check balanced parentheses.
Q23. Queue is also called:
A) Waiting list
B) Processing list
C) Sorted list
D) Dynamic list
Answer: A
Explanation: Queue works like a waiting line where first person gets served first.
Q24. In stack, deletion happens from:
A) Bottom
B) Top
C) Middle
D) Front
Answer: B
Explanation: Stack always removes elements from the top.
Q25. Circular queue helps in:
A) Wasting memory
B) Better memory utilization
C) Increasing stack size
D) Reducing sorting time
Answer: B
Explanation: Circular queue avoids unused space and improves memory usage.
Q26. Which operation checks whether stack is empty?
A) isEmpty()
B) push()
C) pop()
D) peek()
Answer: A
Explanation: isEmpty() checks whether there is any element in stack or not.
Q27. Which operation checks whether queue is full?
A) isEmpty()
B) isFull()
C) delete()
D) front()
Answer: B
Explanation: isFull() is used to check overflow condition in queue.
Q28. Multiple stacks can be implemented in:
A) One Array
B) One Queue
C) One Graph
D) One Tree
Answer: A
Explanation: Multiple stacks can be managed efficiently in a single array.
Q29. Deque stands for:
A) Double Ended Queue
B) Dynamic End Queue
C) Direct End Queue
D) Double Entry Queue
Answer: A
Explanation: Deque means Double Ended Queue where both ends are active.
Q30. Stack is useful in:
A) Backtracking
B) Recursion
C) Undo operation
D) All of these
Answer: D
Explanation: Stack is widely used in recursion, backtracking, and undo operations.
Google AdSense Ad Placement Here 📢