answersLogoWhite

0

Evaluation of a postfix expression is done in the following manner:

Scan the expression from the front.

1) If it is a number then push it into the stack.

2) If it is an operator, then pop two numbers from the stack and then evaluate them using the operator and push it back into the stack.


Now consider the given expression. I have presented the sequence in which the expression will be evaluated by using braces.

Note - I am using '!' symbol for uparrow


1231!!-456*7*-

->

12(3!1)!-456*7*-

->

1(2!(3!1))-456*7*-

->

(1-(2!(3!1)))56*7*-

->

(1-(2!(3!1)))(5*6)7*-

->

((1-(2!(3!1)))-((5*6)*7))


This will be your final result.



User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Engineering
Related Questions