Best Answer

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

Q: Why you need convert a expression into postfix expression?

Write your answer...

Submit

Still have questions?

Continue Learning about Math & Arithmetic

By itself you cannot. You need to have a set of values for the variables and the expression which you need to solve.

Write it as sqrt(x) or x1/2 or x0.5

Simply put, an expression does not need an equal sign, while an equation does. Equation: x+y=z Expression: x+y

If you are talking about language translation, then translating expressions requires some creativity. You would need to understand the core intention of the expression and then choose a similiar expression in the target language.

775%

Related questions

convert to perfixed to postfixed

To convert an infix expression to a postfix expression in C programming, you can use the Shunting Yard algorithm. This algorithm allows you to scan the infix expression from left to right, and based on the precedence of operators, convert it to a postfix expression. You can use a stack to hold operators and output queue to store the final postfix expression. By following the algorithm, you can convert the infix expression to postfix successfully.

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.

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.

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:

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

Both the prefix and the postfix increment operators increment the operand. The difference is what is the value of the expression during the evaluation of the expression. In the prefix form, the value is already incremented. In the postfix form, it is not. int a = 1; int b = ++a; // both a and b are now equal to 2 int a = 1; int b = a++; // a is equal to 2 and b is equal to 1

Postfix expressions are expressions where the operator is at the end of the expression. These include the "++" (increment) and "--" (decrement) operators. Most Java expressions use in-fix notation (e.g. "a + b") but the increment and decrement operators can be postfix ("e.g. "a++" to increment variable a) or even prefix (e.g. "++a").

Okay, here is a postfix expression: 3 4 * 5 6 * + the evaluation: 3*4 + 5*6 12 + 30 42

stack is the basic data structure needed to convert infix notation to postfix

Without data-structures you cannot even store expressions, let alone convert or evaluate them.

Scan the postfix expression from left to right and count the number of values and the number of operators. The maximum value of their difference is the required stack size. Eg: 1 2 3 + 4 + * 1 2 3 2 3 2 1 The maximum is 3.