Science, asked by christiana19, 5 months ago

an algorithm that can evaluate a postfix arithmetic expression?

Answers

Answered by Anonymous
0

There are two algorithms involved. One converts an infix expression to postfix form, and the other evaluates a postfix expression. Each uses a stack.

Hope it helps ♥️

Answered by HA7SH
18

Explanation:

Evaluation rule of a Postfix Expression states:

While reading the expression from left to right, push the element in the stack if it is an operand.

Pop the two operands from the stack, if the element is an operator and then evaluate it.

Push back the result of the evaluation. Repeat it till the end of the expression.

Evaluation of Arithmetic Expressions

Expressions within parentheses are evaluated first. When parentheses are nested, the innermost set of parentheses is evaluated first, and then successively more inclusive parentheses are evaluated.

Similar questions