answersLogoWhite

0


Best Answer

You convert an (infix) expression into a postfix expression as part of the process of generating code to evaluate that expression.

User Avatar

Wiki User

โˆ™ 2010-08-25 02:28:05
This answer is:
User Avatar
Study guides

Mixture

1 card

Class

โžก๏ธ
See all cards
4.35
โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…
23 Reviews

Add your answer:

Earn +20 pts
Q: Why you need convert a expression into postfix expression?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write an algorithm to convert infix expression into postfix expression?

Write and explain a 'C' function to convert the given infix expression to postfix expressionWrite and explain a 'C' function to convert the given infix expression to postfix expression


What is need to convert infix to postfix expression in data structures?

it is needed in compiler designing


Postfix to infix?

convert postfix notation to infix notation in c?


How to convert prefix to postfix?

convert to perfixed to postfixed


Write a program to evaluate a postfix expression?

No


Write a c program to evaluate postfix expression?

Yes, you should.


Write an algorithm in c to convert an infix expression to a postfix expressionexecute your algorithm with the following infix expression as your input. m nk pgh a bc?

An algorithm can not be written with the following infix expression without knowing what the expression is. Once this information is included a person will be able to know how to write the algorithm.


Why do compilers convert infix expressions to postfix?

people almost exclusively use infix notation to write mathematical expressions, computer languages almost exclusively allow programmers to use infix notation. However, if a compiler allowed infix expressions into the binary code used in the compiled version of a program, the resulting code would be larger than needed and very inefficient. Because of this, compilers convert infix expressions into postfix notation expressions, which have a much simpler set of rules for expression evaluation. Postfix notation gets its name from the fact that operators in a postfix expression follow the operands that they specify an operation on. Here are some examples of equivalent infix and postfix expressions Infix Notation Postfix Notation 2 + 3 2 3 + 2 + 3 * 6 3 6 * 2 + (2 + 3) * 6 2 3 + 6 * A / (B * C) + D * E - A - C A B C * / D E * + A C * - Where as infix notation expressions need a long list or rules for evaluation, postfix expressions need very few.


Program in C language to convert postfix into prefix?

a+v+l


Convert infix to prefix to postfix?

(a + b) * c / ((x - y) * z)


Sample program of postfix to infix?

You can convert from postfix to infix through the use of stacks. Consider the following expression conversion:54+67*+ -> ((5+4)+(6*7))The way this can be achieved is that whenever you encounter an operator, pop the last two expressions and join them using the operator. Remember to include the open braces before the first expression and a close braces after the second expression. Check the given link below for the program:


How do you convert postfix expression to prefix expression using c plus plus?

The only postfix/prefix operators in C++ are the increment and decrement operators. Converting from one to the other is simply a matter of moving the operator before (prefix) or after (postfix) the operand.int x = 1;++x; // prefix (increments x and returns the new value of x)x++; // postfix (increments x but returns the original value of x)--x; // prefix (decrements x and returns the new value of x)x--; // postfix (decrements x but returns the original value of x)The prefix operators are functionally equivalent to:// prefix incrementint result = ( x = x + 1 );// prefix decrementint result = ( x = x - 1 );The postfix operators are functionally equivalent to:// postfix incrementint result = x;x = x + 1;// postfix decrementint result = x;x = x - 1;

People also asked