Reverse Polish Notation : RPN : Postfix Operation : STACK : Infix to Postfix conversion

Опубликовано: 20 Апрель 2018
на канале: Computer Science Academy By Dinesh Sir
11,693
89

In this lecture, you will learn the concept of Reverse Polish Notation of Stack. How we will convert the Infix operation into Postfix Operation or Reverse Polish Notation in easy way with example.
How the elements will insert (PUSH) into STACK and POP from stack ?
Definitely You will be able to convert the infix to postfix.

Definition : Reverse Polish notation (RPN) is a mathematical notation in which every operator follows all of its operands.
Stack machines execute data manipulation operations using postfix operations. These operations are usually called "Reverse Polish" after the Reverse Polish Notation (RPN) that is often used to describe postfix operations.
Postfix operations are distinguished by the fact that the operands come before the operation(op-code).

Example : Arithmetic Expressions: A + B

Infix notation : A + B
Prefix or Polish notation : + A B
Postfix or Reverse Polish notation(RPN): A B +

The reverse Polish notation is very suitable for stack manipulation

Evaluation of Arithmetic Expressions:

Any arithmetic expression can be expressed in parenthesis-free
Polish notation, including reverse Polish notation

(3 * 4) + (5 * 6)  3 4 * 5 6 * +


For more videos subscribe the channel : Computer Science Academy By Dinesh Sir.