The infix expression $A+(B-C)^*D$ is correctly represented in prefix notation as
Option B
Scan Right to Left
Stack : * ) -
Pop - ) by seeing (
Stack: *
Pop * as incoming is +
Stack : +
Output : +A*-BCD
( ) has highest priority then * then +.
so whatever inside the bracket will be evaluated first
A+(−BC) *D
A+((−BC) *D))
A+(*−BCD)
(A+(*−BCD))
+A*−BCD
OPTION B
64.3k questions
77.9k answers
244k comments
80.0k users