For the evaluation of post-fix notation, we use the stack data structure. The following are the rules of evaluating post-fix notation using stack:
Start scanning from left to right.
If the current value is an operand, push it onto the stack.
If the current is an operator, pop two elements from the stack, apply the at-hand operator on those two popped operands, and push the result onto the stack.
At the end, pop an element from the stack, and that is the answer.
Download
0 formats
No download links available.
Evaluation of Prefix Expression || Prefix Evaluation || example #2 | NatokHD