+1 vote
in Data Structures & Algorithms I by (110k points)
The prefix expression of the postfix expression AB+CD-* is __________

(a) (A+B)*(C-D)

(b) +AB*-CD

(c) A+*BCD-

(d) *+AB-CD

The doubt is from Application of Stacks in portion Application of Stacks of Data Structures & Algorithms I

I had been asked this question in an online quiz.

1 Answer

+1 vote
by (408k points)
selected by
Best 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,

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.