Sunday, 1 October 2017

Need for Prefix and Postfix Expressions

We have studied that evaluation of an infix expression using a computer system needs proper program generated by the compiler without any further ambiguity and is difficult because of various aspects such as the operator's priority and associativity. This problem can be overcome by writing or converting the infix expression to an alternate notation such as the prefix or the postfix. The postfix and prefix expressions possess many advantages as follow:



1. The need for parenthesis as in an infix expression is overcome in postfix and prefix notations.

2. The priority of operators is no longer relevant.

3. The order of evaluation depends on the position of the operator but not on priority ans associativity.

4. The expression evaluation process is much simpler than attempting a direct evaluation from the infix notation.



Thanks
Mukesh Rajput

No comments:

Post a Comment

Thanks
Mukesh Rajput