# YOU CAN DOWNLOAD 200+ SUBJECTS PDF BOOK FOR COMPETITIVE EXAMINATIONS

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

Question 1 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

When an operand is read, which of the following is done?

It is placed on to the output | |

It is placed in operator stack | |

It is ignored | |

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 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

What should be done when a left parenthesis '(' is encountered?

It is ignored | |

It is placed in the output | |

It is placed in the operator stack | |

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 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

Which of the following is an infix expression?

(a+b)*(c+d) | |

ab+c* | |

+ab | |

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 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

What is the time complexity of an infix to postfix conversion algorithm?

O(N log N) | |

O(N) | |

O(N ^{2}) | |

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 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER] |

What is the postfix expression for the corresponding infix expression?

a+b*c+(d*e)

abc*+de* | |

abc+*de* | |

a+bc*de+* | |

abc*+(de)* |

Question 5 Explanation:

Using the infix to postfix expression conversion algorithm, the corresponding postfix expression is found to be abc*+de*.

There are 5 questions to complete.