Binary Expression Trees

1. Given the BXT at right, state the following:
 infix form postfix form prefix form evaluate

2. Evaluate the prefix expression `/ - + A B C D`, where A = 6, B = 5, C = 2, D = 3
Give its postfix form.
Draw the BXT.

3. Express the algebraic expression below in postfix form.

Evaluate the following postfix expressions.
1. `3 4 2 * +`
2. `3 4 + 5 *`
3. `2 4 + 5 3 - *`
4. `3 2 ^ 2 3 * 5 * + 5 2 ^ + `
5. `4 5 7 6 9 + * + *`
6. `2 3 4 + * 7 3 2 * + /`
7. `2 3 4 * + 2 8 1 4 3 * + + * /`
8. `1 2 3 4 5 * + - + `

Evaluate the following postfix expressions.

9. `+ * 2 3 4 `
10. `* + 2 3 4 `
11. `+ - 2 3 / 6 3`
12. `/ - 9 3 * 3 2`
13. `* + 2 3 + * 4 5 6`

Translate the infix expressions into postfix.

14. `2 * (3 + 4 * 5) * 6`
15. `(1 + 2) * (A - 3) ^ 2 * F`
16. `(A + B) * (C * (D - E) + F) - G`
17. `A + B + C`
18. `A * B + C * (D + E) / F + G`
19. `A + (B * C) + D / E * (F + G)`
20. `A / B + C * (D + E) * (F / G)`
21. `A / (B * (C - (D * (E + (F * G)))))`

Continue to:  Unit 8 / Prev / Next