The postfix form of the expression (A+ B)*(C*D- E)*F / G is?1 pointAB+ CD*E – FG /**AB + CD* E – F **G /AB + CD* E – *F *G /AB + CDE * – * F *G /
Question
The postfix form of the expression (A+ B)(CD- E)F / G is?1 pointAB+ CDE – FG /*AB + CD E – F *G /AB + CD E – *F *G /AB + CDE * – * F *G /
Solution 1
The postfix form of the given infix expression (A + B) * (C * D - E) * F / G is:
AB+ CD*E- FG/
Here's how you can convert the infix expression to postfix:
- Scan the infix expression from left to right.
- If the scanned character is an operand, output it.
- Else,
- If the precedence of the scanned operator is greater than the precedence of the operator in the stack(or the stack is empty), push it.
- Else, Pop the operator from the stack until the precedence of the scanned operator is less-equal to the precedence of the operator residing on the top of the stack. Push the scanned operator to the stack.
- If the scanned character is an '(', push it to the stack.
- If the scanned character is an ')', pop and output from the stack until an '(' is encountered.
- Repeat steps 2-6 until infix expression is scanned.
- Pop and output from the stack until it is not empty.
Solution 2
The postfix form of the given infix expression (A + B) * (C * D - E) * F / G is:
Step 1: Add parentheses to the infix expression based on the precedence of the operators. The precedence of operators is as follows: Parentheses > Exponentiation > Multiplication and Division > Addition and Subtraction.
So, the expression becomes: ((A + B) * ((C * D) - E) * F) / G
Step 2: Convert the infix expression to postfix expression.
The postfix expression becomes: AB+CDE-FG/
So, the correct answer is AB+CDE-FG/.
Similar Questions
The postfix form of the expression (G+ F)*(E*D- C)*B / A is?GF+ ED*C - BA /**GF + ED* C- B **A/GF+ EDC * - * B *A /GF + ED* C - *B *A /
he postfix form of the expression (G+ F)*(E*D- C)*B / A is?
The postfix form of A*B+C/D is?*AB/CD+AB*CD/+A*BC+/DABCD+/*
Convert the expression ((A + B) * C – (D – E) ^ (F + G)) to equivalent Postfix notation.OptionsAB + C * DE - - FG ^ +AB + C * DE - - FG + ^AB + C * DE + - FG - ^AB + C - DE * - FG + ^
The result for the Postfix Expression ab*cd*+ where a=2, b=2, c=3, d=4 is
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.