Write the formula of Example 15.4 as an expression tree (a syntax tree in which each operator

Question:

Write the formula of Example 15.4 as an expression tree (a syntax tree in which each operator is represented by an internal node whose children are its operands). Convert your tree to an expression DAG by merging identical nodes. Comment on the redundancy in the tree and how it relates to Figure 15.4.

Figure 15.4:

push a push b push c r2 := a r3:= b r4 := c add r1 := r2 + r3 add r1 := r1 + r4 push 2 r1 := r1/2 --S divide pop s push s push s r2 := r1 – r2 --S - a push a subtract

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: