user1705636
user1705636

Reputation: 233

what is benefits for changing from infix to postfix?

I read book today. It introduced algorithm about chaning from infix to postfix.. What is benefits? Thanks in advance.

Upvotes: 2

Views: 4446

Answers (4)

YOGESH KUMAR GUPTA
YOGESH KUMAR GUPTA

Reputation: 1

infix and postfix concept are used in compiler design. Because Infix is so common in mathematics, it is much easier for humans to read, and so is used in most computer languages. Postfix is easier for computers to process, but not as intuitive for humans.

Upvotes: 0

Arvind
Arvind

Reputation: 478

An advanced example that also illustrates the convenience of infix to prefix/postfix :

Writing your own Regular Expression Parser : The regular expression input with paranthesis ie, (a+b)*(c+d) is converted to prefix/postfix, before the state machine for the regular expression is built

Upvotes: 0

Han
Han

Reputation: 3334

I think infix is really easy to understand for human. Postfix is the good way for machine to process. Please prefer: http://www.cs.man.ac.uk/~pjj/cs2121/fix.html

Upvotes: 2

srbhkmr
srbhkmr

Reputation: 2104

Well for one, you can easily evaluate a postfix expression in a single scan from left to right with the help of a stack, unlike evaluating infix expressions. and second, there is no need of the concept of parentheses and precedence rules etc. in a postfix expression.

Upvotes: 7

Related Questions