E?E+T { printf("+") } |T {} T?T*F { printf("*") } |F {} F?T num { printf(num.lvalue) } String = 2*9+5*6*4+1+7*2*3
Added by David R.
Close
Step 1
The given string expression is in infix notation. To convert it into postfix notation, we follow the rule that operators follow their operands. The equivalent postfix notation of the given string expression would be: 2 9 * 5 6 4 * * + 1 + 7 2 * 3 * +. Show more…
Show all steps
Your feedback will help us improve your experience
John Incabo and 69 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
a) Represent the expressions $(x+x y)+(x / y)$ and $x+((x y+x) / y)$ using binary trees. Write these expressions in b) prefix notation. c) postfix notation. d) infix notation.
Trees
Tree Traversal
a) Represent the expression $((x+2) \uparrow 3) *$ $(y-(3+x))-5$ using a binary tree. Write this expression in b) prefix notation. c) postfix notation. d) infix notation.
1. Write a program which can convert infix expression into prefix expression using Lex and Yacc. 2. Write a program which can convert postfix expression into prefix expression using Lex and Yacc. Use Lex and Yacc to do their specific jobs
Madhur L.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD