1.

What is the postfix expression of (A+B)-C*(D/E))+F?(a) A B + C D E / * – F +(b) A B CD E + / * F – +(c) A B C + * D E /F + –(d) A B + C – * D E / F +This question was addressed to me during a job interview.I'd like to ask this question from Trees topic in section Trees of Discrete Mathematics

Answer»

The correct choice is (a) A B + C D E / * – F +

To elaborate: The EXPRESSION is (A+B)-C*(D/E))+F

= (A+B)-C*(DE/)+F

= (A+B)-C*(DE/)F+

= (A+B)-C(DE/)*F+

= (A+B)C(DE/)*-F+

= (AB+)C(DE/)*-F+

So the output is: AB+CDE/*-F+.



Discussion

No Comment Found

Related InterviewSolutions