4.3.3 Reverse Polish Notation Flashcards
Why do we use the infix notation?
It is the more preferable option to humans in terms of readability and comprehension.
Which side is the operand?
Either side of the opcode.
What is reverse Polish notation?
A postfix way of writing expressions.
Why do we use RPN?
To eliminate the need for brackets and confusion over the order of execution.
In RPN where does the opcode go?
After the the operand in a postfix expression.
How do you convert from infix to postfix?
By the post order traversal of an expression tree.
What else can be used to evaluate a postfix expression?
Stacks and and pseudocode.
What is the process of using a stack with RPN?
The algorithm goes along the array.
Operand is used on the stack.
The opcode causes two items to be popped off the stack.
Results of the operation pushed on the stack.