Question: 1) What is the result of evaluation of following postfix expression, A=4, B=6, C=2, D=12, E=3, F=2, G=-1 AB + C * DE +-
1) What is the result of evaluation of following postfix expression, A=4, B=6, C=2, D=12, E=3, F=2, G=-1 AB + C * DE +- FG + * stack-the empty stack While (not end of input){ symb = next input character If (symb is an operand) then Else { /* symb is an operator */ op2 = pop(stack) op1 = pop(stack) value = result of applying symb to opnd1 and opnd2 Push(stack, value) } }/* end while */ return (pop(stack) symb op2 Push(stack, symb) op1 value push pop top stack
Step by Step Solution
3.44 Rating (144 Votes )
There are 3 Steps involved in it
To evaluate the given postfix expression using the provided values we can follow the algorithm 1 Ini... View full answer
Get step-by-step solutions from verified subject matter experts
