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

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

 Question 1
What data structure is used when converting an infix notation to prefix notation?
 A Stack B Queue C B-Trees D Linked-list
Question 1 Explanation:
First you reverse the given equation and carry out the algorithm of infix to postfix expression. Here, the data structure used is stacks.

 Question 2
What would be the Prefix notation for the given equation?

A+(B*C)
 A +A*CB B *B+AC C +A*BC D *A+CB
Question 2 Explanation:
Reverse the equation or scan the equation from right to left. Apply the infix-postfix algorithm. The equation inside the bracket evaluates to CB* and outside the bracket evaluates to A+ therefore getting CB*A+. Reversing this and we get +A*BC.

 Question 3
What would be the Prefix notation for the given equation?

(A*B)+(C*D)
 A +*AB*CD B *+AB*CD C **AB+CD D +*BA*CD
Question 3 Explanation:
Reverse the equation or scan the equation from right to left. Apply the infix-postfix algorithm. The equation inside the brackets evaluate to DC* and BA* respectively giving us DC*BA*+ in the end. Reversing this we get the +*AB*CD.

 Question 4
What would be the Prefix notation for the given equation?

A+B*C^D
 A +A*B^CD B +A^B*CD C *A+B^CD D ^A*B+CD
Out of the following operators (^, *, +, &, $), the one having highest priority is .....  A + B$ C ^ D &