Write algorithm to evaluate a postfix expression. Apply the same to
evaluate the following postfix espression.
3 5 2 - 7
Answers
Answered by
0
Explanation:
Following is algorithm for evaluation postfix expressions.
Create a stack to store operands (or values).
Scan the given expression and do following for every scanned element. …..a) If the element is a number, push it into the stack. ...
When the expression is ended, the number in the stack is the final answer.
Similar questions
Social Sciences,
3 months ago
Math,
3 months ago
English,
7 months ago
Math,
7 months ago
English,
1 year ago