Given the following expression: a − b * c / d + e * f − g / h. A. Using the rules of precedence write this expression with parentheses and/or square bracketshow the order of evaluation of the infix expression, by: first evaluating * and / from left to right, and then evaluating + and − from left to right. B. Create the binary infix tree for this expression (WITHOUT parentheses or square brackets). C. Show the prefix expression corresponding to the infix tree.
Given the following expression:
a − b * c / d + e * f − g / h.
A. Using the rules of precedence write this expression with parentheses and/or square bracketshow the order of evaluation of the infix expression, by:
first evaluating * and / from left to right, and
then evaluating + and − from left to right.
B. Create the binary infix tree for this expression (WITHOUT parentheses or square brackets).
C. Show the prefix expression corresponding to the infix tree.
D. Show the postfix expression corresponding to the infix tree.
Then let a = -2, b = -1, c = 0, d = 1, e = 2, f = 3, g = 4, and h = 2, and using these values:
i. Show each step in the order of evaluation for a), above
ii. Show each step in the order of evaluation for c), above
iii. Show each step in the order of evaluation for d), above
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images