# Find the value of the arithmetic expression...

• 03-15-2011, 05:21 PM
hydride
Find the value of the arithmetic expression...
Hey guys, so the question is: Find the value of the arithmetic expression associated with each subtree of the binary tree below.

I just don't know what it's asking me to do. Someone please explain. Thank you.

http://img849.imageshack.us/img849/7175/scan0005g.jpg
• 03-15-2011, 05:57 PM
JosAH
Quote:

Originally Posted by hydride
Hey guys, so the question is: Find the value of the arithmetic expression associated with each subtree of the binary tree below.

I just don't know what it's asking me to do. Someone please explain. Thank you

The image you've shown us most definitely has nothing to do with a binary tree; it just describes a post order traversal of any tree. You have to evaluate a binary expression tree. First recursively evaluate the children of a node and keep the results; next evaluate the current node and return the result.

kind regards,

Jos
• 03-16-2011, 09:21 AM
Cbani
click on the image to see the tree
• 03-16-2011, 10:17 AM
JosAH
Quote:

Originally Posted by Cbani
click on the image to see the tree

When I click on that image I see the same tree (and a bunch of popups) and that tree has nothing to do with an expression tree.

kind regards,

Jos