Data Structures MCQs with Answers
Practice important Data Structures MCQs with answers and explanations.
Multiple Choice Questions
Q141: What is the postfix conversion of the infix expression (A + B) * (C + D)?
- A: AB+CD+*
- B: ABCD+*+
- C: ABCD+
- D: A+BC+D
View Answer
A
Q142: What does the postfix expression eliminate from the original infix expression?
- A: Operands
- B: Operators
- C: Parentheses
- D: Variables
View Answer
C
Q143: In the conversion from infix to postfix, where are operators temporarily stored?
- A: In the output
- B: In the stack
- C: In the input
- D: In a queue
View Answer
B
Q144: Which operator should be evaluated first in the infix expression (A + B) * C?
- A: A
- B: B
- C: +
- D: *
View Answer
C
Q145: What happens when a closing parenthesis ')' is encountered during infix to postfix conversion?
- A: It is added to the postfix expression
- B: It is ignored
- C: Operators are popped from the stack
- D: Operand is pushed onto the stack
View Answer
C
Q146: What type of C++ feature allows the same code to work with different data types?
- A: Macro
- B: Template
- C: Class
- D: Function
View Answer
B
Q147: In a C++ template, what does 'T' generally represent?
- A: A class name
- B: A function name
- C: A generic data type
- D: An object
View Answer
C
Q148: Which data structure is typically used to evaluate postfix expressions?
- A: Queue
- B: Array
- C: Stack
- D: Linked List
View Answer
C
Q149: What is the main advantage of using postfix notation over infix notation?
- A: Simpler evaluation
- B: More readable
- C: Fewer operators
- D: Less memory usage
View Answer
A
Q150: What does the 'push' function do in the Stack class template?
- A: Removes an element from the stack
- B: Adds an element to the stack
- C: Checks if the stack is full
- D: Retrieves the top element of the stack
View Answer
B