1.

The prefix expression of the postfix expression AB+CD-* is __________(a) (A+B)*(C-D)(b) +AB*-CD(c) A+*BCD-(d) *+AB-CDThe doubt is from Application of Stacks in portion Application of Stacks of Data Structures & Algorithms II had been asked this question in an online quiz.

Answer» CORRECT answer is (d) *+AB-CD

To explain: To CONVERT from postfix to PREFIX, we FIRST convert it to infix and then to prefix.

postfix :AB+CD-*

infix ⇒ (A+B) * (C-D)

So,prefix ⇒ +AB*-CD,


Discussion

No Comment Found

Related InterviewSolutions