Question
Evaluate the following Postfix notation of expression:
2,3,*,24,2,6,+,/,-
Solution
Element Stack |
Contents |
2 |
2 |
3 |
2,3 |
* |
6 |
24 |
6, 24 |
2 |
6, 24, 2 |
6 |
6, 24, 2, 6 |
+ |
6, 24, 8 |
/ |
6, 3 |
|
3 |