Question

#data structures Give the infix form of the following postfix expression. 1 A B C +...

#data structures
Give the infix form of the following postfix expression.
1 A B C + * D - E F + K - +
Give the postfix form of the following infix expression.
2    ( A + B ) * ( C - D + E )

Homework Answers

Answer #1

1.(((A*(B+C))-D)+((E+F)-K))

Input String Postfix expression Stack(Infix)
ABC+*D-EF+K-+ ABC+*D-EF+K-+
ABC+*D-EF+K-+ BC+*D-EF+K-+ A
ABC+*D-EF+K-+ C+*D-EF+K-+ AB
ABC+*D-EF+K-+ +*D-EF+K-+ ABC
ABC+*D-EF+K-+ *D-EF+K-+ A(B+C)
ABC+*D-EF+K-+ D-EF+K-+ (A*(B+C))
ABC+*D-EF+K-+ -EF+K-+ (A*(B+C))D
ABC+*D-EF+K-+ EF+K-+ ((A*(B+C))-D)
ABC+*D-EF+K-+ F+K-+ ((A*(B+C))-D)E
ABC+*D-EF+K-+ +K-+ ((A*(B+C))-D)EF
ABC+*D-EF+K-+ K-+ ((A*(B+C))-D)(E+F)
ABC+*D-EF+K-+ -+ ((A*(B+C))-D)(E+F)K
ABC+*D-EF+K-+ + ((A*(B+C))-D)((E+F)-K)
ABC+*D-EF+K-+ (((A*(B+C))-D)+((E+F)-K))

2.AB+CDE+-*

Expression Stack Postfix Expression
( ((
A (( A
+ ((+ A
B ((+ AB
) ( AB+
* (* AB+
( (*( AB+
C (*( AB+C
- (*(- AB+C
D (*(- AB+CD
+ (*(-+

AB+CD

E (*(-+ AB+CDE
) (* AB+CDE+-
) AB+CDE+-*
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Convert the given infix expression to a postfix expression: a + b * c
Convert the given infix expression to a postfix expression: a + b * c
Please give the postfix form of the arithmetic expression (a*b + 2*c)/(2 - 3*d) + c
Please give the postfix form of the arithmetic expression (a*b + 2*c)/(2 - 3*d) + c
Convert the following infix expressions to postfix. a * b + c – d a +...
Convert the following infix expressions to postfix. a * b + c – d a + b / (c + d)
in Java In this exercise, you'll write a Java version of the infix-to-postfix conversion algorithm. These...
in Java In this exercise, you'll write a Java version of the infix-to-postfix conversion algorithm. These same mechanisms can be used as a part of writing a simple compiler. Write class InfixToPostfixConverter co convert an ordinary infix arithmetic expression (assume a valid expression is entered) with single-digit integers (to make things easier) such as (6 + 2) • 5 - 8 / 4 to a postfix expression. The postfix version (no parentheses are needed) of this infix expression is 6...
10) What is the value of this prefix expression when read as an infix expression? Draw...
10) What is the value of this prefix expression when read as an infix expression? Draw the ordered rooted tree corresponding to the below arithmetic expressions written in prefix notation. a) x,/,9,3,+,x,2,4,-,7,6 b) -,x,2,/,8,4,3 c) 5,2,1,-,-,3,1,4,+,+,x d) 9,3,/,5,+,7,2,-,x
Phospholipids can form all the following structures in a water environment except? a)chloroplasts b) bilayers c)...
Phospholipids can form all the following structures in a water environment except? a)chloroplasts b) bilayers c) Chromosomes d) Endoplasmic reticulum e) nuclear membrane
Something is either messed up in my operator overload <<, covertopostfix function, or my main output....
Something is either messed up in my operator overload <<, covertopostfix function, or my main output. Cannot figure it out. please help. Please comment your changes too. Program below is supposed to be outputting like this: InFix is:   A+B-C Post fix is:   A B + C - InFix is:   A+C Post fix is:   A C + InFix is:   x*(y+z)-(w+t) Post fix is:   x y z + * w t + - InFix is:   A+B*(C+D)-E/F+G+H Post fix is:   A B C...
Use C++ Your program should expect as input from (possibly re-directed) stdin a series of space-...
Use C++ Your program should expect as input from (possibly re-directed) stdin a series of space- separated strings. If you read a1 (no space) this is the name of the variable a1 and not "a" followed by "1". Similarly, if you read "bb 12", this is a variable "bb" followed by the number "12" and not "b" ,"b", "12" or "bb", "1" ,"2". Your program should convert all Infix expressions to Postfix expressions, including expressions that contain variable names. The...
Draw the structures of the following compounds. If the name provided is incorrect, give the correct...
Draw the structures of the following compounds. If the name provided is incorrect, give the correct name. a. pentoxyethane                      b. 3-chloro-4-methyl-6-heptyne                       c. 2-ene-4-octyne d. 3,4,5-pentanetriol                    e. 1-Methylcyclopentanol                                                      f. 1,3,5-cyclohexatriene
Which of the following can form an ester bond? A. pancreatic lipase B. bile C. acyl...
Which of the following can form an ester bond? A. pancreatic lipase B. bile C. acyl CoA Synthetase D. B-48 E. lipoprotein lipase F. colipase G. A, B, C, D, E, F H. A, C, D, E, F I. A, C, D, E J. A, C, E K. A, E L. A, F M. A, B, F N. C, D, E O. C, D P. D, E Q. C, E R. None of the above.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT