Evaluation of Postfix Expression
Example 3:
Evaluate the following Postfix Expression: 623+-382/+*2$3+
Symb
|
Operand1
|
Operand2
|
Value
|
Operand
Stack
|
6
|
|
|
|
6
|
2
|
|
|
|
6, 2
|
3
|
|
|
|
6, 2, 3
|
+
|
2
|
3
|
5
|
6, 5
|
-
|
6
|
5
|
1
|
1
|
3
|
|
|
|
1, 3
|
8
|
|
|
|
1, 3, 8
|
2
|
|
|
|
1, 3, 8, 2
|
/
|
8
|
2
|
4
|
1, 3, 4
|
+
|
3
|
4
|
7
|
1, 7
|
*
|
1
|
7
|
7
|
7
|
2
|
|
|
|
7, 2
|
$
|
7
|
2
|
49
|
49
|
3
|
|
|
|
49, 3
|
+
|
49
|
3
|
52
|
52 (Result)
|
No comments:
Post a Comment