Evaluate expression tree.

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.
Algorithm:
  1. Traverse Given Binary Tree in PostOrder
    1. If node is null then
      1. return 0
    2. If node is leaf node then
      1. return node.data
    3. leftValue = recursively call left substree with node.left
    4. rightValue = recursively call right substree with node.right
    5. value = perform binary arithmetic operation on leftValue and rightValue with using
    6. return value

Latest Source Code:
Github: EvaluateExpressionTree.java


Output:

        +               
      / \       
     /   \      
    /     \     
   /       \    
   +       10       
  / \           
 /   \          
 30   *           
    / \         
    10 20         
                                
Value is : 240
Author: Hrishikesh Mishra