private int diameter(Node root, Height height){
    
        if(root == null){
            return 0;
        }
        
        Height leftHeight = new Height();
        Height rightHeight = new Height();
        int dial = diameter(root.left,leftHeight);
        int diar = diameter(root.right,rightHeight);
        height.height = Math.max(leftHeight.height, rightHeight.height) + 1;
        return Math.max(Math.max(dial, diar),(1 + leftHeight.height + rightHeight.height));
    }
http://www.geeksforgeeks.org/diameter-of-a-binary-tree/
Test cases
All left nodes
All right nodes
src/com/interview/tree/DiameterOfTree.java