Evaluation of Postfix Expression Examples
Click on the examples for solutions
Materials of VTU CBCS 7th sem Machine Learning(15CS73), Machine Learning Lab(15CSL76), 6th sem Python Application Programming(156CS664), 3rd sem Data Structures (15CS33), Data Structure in C Lab (15CSL38)
Symb
|
Operand1
|
Operand2
|
Value
|
Operand
Stack
|
7
|
|
|
|
7
|
5
|
|
|
|
7, 5
|
3
|
|
|
|
7, 5, 3
|
2
|
|
|
|
7, 5, 3, 2
|
^
|
3
|
2
|
9
|
7, 5, 9
|
*
|
5
|
9
|
45
|
7, 45
|
9
|
|
|
|
7, 45, 9
|
2
|
|
|
|
7, 45, 9, 2
|
2
|
|
|
|
7, 45, 9, 2, 2
|
^
|
2
|
2
|
4
|
7, 45, 9, 4
|
-
|
9
|
4
|
5
|
7, 45, 5
|
/
|
45
|
5
|
9
|
7, 9
|
+
|
7
|
9
|
16
|
16
|
6
|
|
|
|
16, 6
|
4
|
|
|
|
16, 6, 4
|
*
|
6
|
4
|
24
|
16, 24
|
+
|
16
|
24
|
40
|
40 (Result)
|
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)
|
Symb
|
Operand1
|
Operand2
|
Value
|
Operand
Stack
|
4
|
|
|
|
4
|
2
|
|
|
|
4, 2
|
$
|
4
|
2
|
16
|
16
|
3
|
|
|
|
16, 3
|
*
|
16
|
3
|
48
|
48
|
3
|
|
|
|
48, 3
|
-
|
48
|
3
|
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