google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 stack mcq | stack mcq questions and answers - 2nd puc computer science

stack mcq | stack mcq questions and answers

stack mcq,stack mcq questions,stack mcq questions and answers,class 12 cs stack mcqs,class 12 stack mcq,mcq on stack,class 12 stack mcq with answers,class 12 stack mcq with answers pdf,class 12 stack mcq pdf,class 12 stack mcq pdf download,class 12 stack mcq with answers pdf free download,class 12 stack mcq with answers pdf download,class 12 stacl mcq with answers pdf

stack mcq questions and answers

1. What is the principle followed by a Stack?





ANSWER= C) LIFO

2. In Python, which data type is commonly used to implement a stack?





ANSWER= C) List

3. What will happen if a POP operation is performed on an empty stack?





ANSWER= B) Underflow

4. Which of the following is NOT a real-life example of a stack?





ANSWER= B) Queue at a movie theatre

5. Which method in Python list is used to remove the top element in a stack?





ANSWER= C) pop()

6. In infix expressions, where are the operators placed?





ANSWER= C) Between operands

7. What is postfix notation also known as?





ANSWER= D) Reverse Polish

8. Which function checks if a stack is empty?





ANSWER= A) isEmpty()

9. What type of error occurs when trying to push an element into a full stack (in languages with fixed stack size)?





ANSWER= C) Overflow

10. What would be the result of evaluating the postfix expression: 7 8 2 * 4 / +?





ANSWER= B) 11

11. Which operator has the highest precedence in arithmetic expressions?





ANSWER= C) *

12. In the conversion of infix to postfix, where are the operators stored during processing?





ANSWER= C) Stack

13. Which function is used to read the topmost element from the stack?





ANSWER= C) peek()

14. What is the output of the top() function when the stack is empty?





ANSWER= B) Error

15. What is the postfix equivalent of the infix expression (x + y)/(z * 8)?





ANSWER= A) xy+z8*/

16. Which of the following is a valid use of stack in text/image editors?





ANSWER= B) Redo/Undo

17. Which stack operation returns the number of elements?





ANSWER= A) size()

18. During infix to postfix conversion, what happens when a right parenthesis is encountered?





ANSWER= C) Operators are popped till left parenthesis

19. Which one of the following statements is FALSE about stack operations in Python (based on the chapter)?





ANSWER= C) We declare stack size in Python

20. What is the postfix expression equivalent of: A * ((C + D) / E)?





ANSWER= A) ACD+E/*

21. Assertion (A): Stack is a linear data structure that follows Last-In-First-Out (LIFO) order. Reason (R): In a stack, insertion and deletion happen at the same end known as TOP.





ANSWER= A) Both A and R are true, and R is the correct explanation of A

22. Assertion (A): The pop() method in Python list implementation of a stack removes the first element. Reason (R): In stack implementation, elements are always inserted and removed from the beginning of the list.





ANSWER= D) A is false, but R is true

23. Assertion (A): Stack is a useful data structure for reversing a string. Reason (R): Stack allows deletion of elements from the bottom, enabling reverse traversal.





ANSWER= C) A is true, but R is false

24. Assertion (A): A stack is used for matching parentheses in expressions. Reason (R): Stack helps in storing and retrieving nested structures in reverse order.





ANSWER= A) Both A and R are true, and R is the correct explanation of A

25. Assertion (A): Overflow condition occurs when an element is inserted into a full stack in Python. Reason (R): Python lists have a fixed size and cannot grow beyond a limit.





ANSWER= C) A is true, but R is false

26. Assertion (A): Infix expressions are easy for humans to read but difficult for machines to evaluate. Reason (R): Infix expressions require knowledge of operator precedence and parentheses handling.





ANSWER= A) Both A and R are true, and R is the correct explanation of A

27. Assertion (A): In postfix notation, parentheses are not required. Reason (R): Postfix notation places operators in a way that respects operator precedence inherently.





ANSWER= A) Both A and R are true, and R is the correct explanation of A

28. Assertion (A): While converting an infix expression to postfix, operands are pushed onto the stack. Reason (R): The stack is used to hold operands and not operators.





ANSWER= C) A is true, but R is false

29. Assertion (A): In evaluation of postfix expression, operators are pushed onto the stack. Reason (R): Stack helps evaluate binary operators from left to right.





ANSWER= D) A is false, but R is true

30. Assertion (A): Stack is a helpful structure in browser history navigation. Reason (R): The back button uses LIFO mechanism to navigate to the previous pages.





ANSWER= A) Both A and R are true, and R is the correct explanation of A

stack mcq | stack mcq questions and answers stack mcq | stack mcq questions and answers Reviewed by Vision Academy on July 10, 2025 Rating: 5

No comments:

CheckOut

Powered by Blogger.