(195 Views)

Infix notation is a type of notation in which arithmetic expressions are written in a manner such that the operators appear in between the operands.

Prefix notation is a type of notation in which arithmetic expressions are written in a manner such that the operands appear after operators. Let's see how to convert Prefix to Infix.

Let's take an example to understand *a+bc,

- Reading from right to left, we scan the operands 'c' 'b' respectively and push it into the the stack.
- '+' is scanned and operands 'c', 'b' are popped and concatenated in form of b+c
- 'a' is then pushed into the stack.
- '*', is encountered and 'a' and string 'b+c' is popped and concatenated to give a string a*(b+c)
- Postfix form is obtained: a*(b+c)

You might be interested in this too.:

0 UpvotesUpvote |
0 DownvotesDownvote |

- Operator Overloading/Function Overloading Program in C++ [234 Views]
- 0/1 Knapsack problem with solution [3524 Views]
- How to emulate sum() using a list comprehension in python? [86 Views]
- Stack Explained with Example in Python [56 Views]
- Steps For Installing Git on Ubuntu 18.04 LTS [743 Views]

- How To Win Ludo King Game Every Time [22174 Views]
- Algorithm to find whether number is Armstrong Number or Not [21543 Views]
- Jio Phone hang on LOGO problem Solution - Hard Reset Jio Phone [14716 Views]
- Knuth-Morris-Pratt (KMP) Substring Search Algorithm with Java Example [14234 Views]
- FlowChart and Algorithm to find Whether a Number is Even or Odd [10743 Views]