Computer Science, asked by harjas2141, 9 months ago

write a program in c++ to evaluate postfix expression using stack kindly use arey data structure.​

Answers

Answered by KeshaDesai
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