DOC PREVIEW
ASU MTE 494 - Expression Trees

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Expression/Equations P. W. Thompson Worksheet 2, Page 1 Worksheet 2 Expression Trees An expression tree shows the structure of an expression—how the expression’s parts fit together. An expression tree is made by following these steps: 1. Put an operation sign at the top. This will be “+ if the expression is a sum, “*” if it is a product, “-“ if it is a difference, and so on. 2. Draw two line segments that drop to the left and to the right of the operation sign. These will connect the operation sign with the things that are being operated upon (called operands). 3. Put the operands below the operation sign at the ends of the line segments. The "trick" to constructing complicated expression trees is to understand that, in step 3, if an operand is an expression, you will have to construct another expression tree. Example: Draw an expression tree for 3*5+2 3*5+2 ————> (3*5)+2Second, write the top operation sign with two branches. +Third, put the things being operated upon at the ends of thebranches. If an expression is one of the things being operatedupon, then repeat these steps to write it as an expression tree.+2*3 5First, rewrite the expression with parentheses.Expression/Equations P. W. Thompson Worksheet 2, Page 2 Part I (Partial trees) Put parentheses where they belong in the expressions. Then complete the expression tree for each expression. Check yourself by comparing your answer with another student. 5 - 10 * 21.2. 4 / 2 + 3 - 43. 4 / ( 2 + 3 - 4 ) 4. 5 * 4 + 6 / 3 - 7 * 2Expression/Equations P. W. Thompson Worksheet 2, Page 3 Part II 1. For each tree, write an expression that will make the tree. a. 3-73* _______________ b. /-+5679 _______________ c. ^+--a1x4y _______________ d. xyx3*-++y _______________Expression/Equations P. W. Thompson Worksheet 2, Page 4 Part III Draw an expression tree for each expression. Check yourself by comparing your answer with another student. 1. 11 - 2 ^ 9 / 3 2. 6 * (x - 8) + 2 * y 3. u * 12 - v * 8 4. 2 * (z - 4) * 8 5. c - d + d / 4 - f * 5 6. c - (d + d / 4 - f) *


View Full Document

ASU MTE 494 - Expression Trees

Download Expression Trees
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Expression Trees and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Expression Trees 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?