# Infix to Postfix Conversion Multiple choice Questions and Answers (MCQs)

## Click on any option to know the CORRECT ANSWERS

 Question 1
When an operand is read, which of the following is done?
 A It is placed on to the output B It is placed in operator stack C It is ignored D Operator stack is emptied

Question 1 Explanation:
While converting an infix expression to a postfix expression, when an operand is read, it is placed on to the output. When an operator is read, it is placed in the operator stack.

 Question 2
What should be done when a left parenthesis '(' is encountered?
 A It is ignored B It is placed in the output C It is placed in the operator stack D The contents of the operator stack is emptied

Question 2 Explanation:
When a left parenthesis is encountered, it is placed on to the operator stack. When the corresponding right parenthesis is encountered, the stack is popped until the left parenthesis and remove both the parenthesis.

 Question 3
Which of the following is an infix expression?
 A (a+b)*(c+d) B ab+c* C +ab D abc+*

Question 3 Explanation:
(a+b)*(c+d) is an infix expression. +ab is a prefix expression and ab+c* is a postfix expression.

 Question 4
What is the time complexity of an infix to postfix conversion algorithm?
 A O(N log N) B O(N) C O(N2) D O(M log N)

Question 4 Explanation:
The time complexity of an infix to postfix expression conversion algorithm is mathematically found to be O(N).

 Question 5
What is the postfix expression for the corresponding infix expression?

a+b*c+(d*e)
 A abc*+de* B abc+*de* C a+bc*de+* D abc*+(de)*