- #1
itech4814
- 10
- 0
I have to convert..
X=A+((B+C)*D)-E
to reverse polish notation
I think it's...
BC+D*A+E-
Is this correct?
X=A+((B+C)*D)-E
to reverse polish notation
I think it's...
BC+D*A+E-
Is this correct?
Infix notation is a mathematical notation in which operators are placed between the operands. For example, in the expression 5 + 3, the operator "+" is placed in between the operands 5 and 3.
Reverse Polish notation, also known as postfix notation, is a mathematical notation in which operators are placed after the operands. For example, in the expression 5 + 3, the operator "+" is placed after the operands 5 and 3, making it 5 3 +.
The purpose of converting Infix to Reverse Polish notation is to make the expression easier to evaluate for a computer. Reverse Polish notation eliminates the need for parentheses and follows a specific order of operations, making it simpler for a computer to process.
Infix to Reverse Polish notation conversion is done using the shunting-yard algorithm. This algorithm uses a stack data structure to reorder the operands and operators in the expression, following the rules of Reverse Polish notation.
Some advantages of using Reverse Polish notation include its simplicity and efficiency for computer processing, as well as its ability to eliminate ambiguity and reduce the number of parentheses in expressions. It also allows for easy conversion to and from other notations, making it a versatile choice for mathematical notation.