Difference between revisions of "Reverse Polish"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Created page with "dibs")
 
Line 1: Line 1:
dibs
+
Reverse Polish Notation is a mathematical notation, in which the operator follows the operands. The result is the removal of the need for parenthesis, because each operation only applies to a fixed number of values.
 +
 
 +
For example:
 +
"3 4 +" is equal to 7, 3 + 4 using Infix notation.
 +
"3 4 + 2 *" is equal to 14, (3+4)*2. Because the operator applies to only two values (in this case) before it, allowing the removal of parenthesis completely.

Revision as of 08:54, 16 May 2017

Reverse Polish Notation is a mathematical notation, in which the operator follows the operands. The result is the removal of the need for parenthesis, because each operation only applies to a fixed number of values.

For example: "3 4 +" is equal to 7, 3 + 4 using Infix notation. "3 4 + 2 *" is equal to 14, (3+4)*2. Because the operator applies to only two values (in this case) before it, allowing the removal of parenthesis completely.