write a program in c++ to evaluate postfix expression using stack kindly use arey data structure.
Answers
Answered by
0
Explanation:
For solving mathematical expression, we need prefix or postfix form. After converting infix to postfix, we need postfix evaluation algorithm to find the correct answer.
Here also we have to use the stack data structure to solve the postfix expressions.
From the postfix expression, when some operands are found, pushed them in the stack. When some operator is found, two items are popped from stack and then operation is performed in correct sequence. After that the result is also pushed in the stack for future use. After completing the whole expression, the final result is also stored in the stack top.
Similar questions
Hindi,
4 months ago
Environmental Sciences,
4 months ago
Science,
4 months ago
Math,
9 months ago
Social Sciences,
9 months ago
Math,
1 year ago
English,
1 year ago
Math,
1 year ago