Parse Trees - Arithmetic Expressions

1.5k Views Asked by At

In regards to the right side of this expression (c * (a-b)) how is it factored to include (-) instead of * and then (-) again?

enter image description here

I cant understand what steps my teacher made to do this.

1

There are 1 best solutions below

0
On

The tree is wrong; your instructor screwed up. The tree shown there is for $(3\cdot a+5\cdot(b+a))/(c-(a-(b\cdot c)))$. Also, it is not a parse tree, but an abstract syntax tree.