Evaluate expression tree.
Given a simple expression tree, which is also a full binary tree consisting of basic binary operators i.e., + , – ,* and / and some integers.
- Traverse Given Binary Tree in PostOrder
node is nullthen
node is leaf nodethen
- leftValue = recursively call left substree with node.left
- rightValue = recursively call right substree with node.right
value = perform binary arithmetic operation on leftValue and rightValue with using
- return value
Latest Source Code:
+ / \ / \ / \ / \ + 10 / \ / \ 30 * / \ 10 20 Value is : 240