public static void main(String args[]){
        BinaryTree bt = new BinaryTree();
        Node head = null;
        head = bt.addNode(10, head);
        head = bt.addNode(15, head);
        head = bt.addNode(5, head);
        head = bt.addNode(7, head);
        head = bt.addNode(19, head);
        head = bt.addNode(20, head);
        head = bt.addNode(-1, head);
        head = bt.addNode(21, head);
        head = bt.addNode(11, head);
        head = bt.addNode(12, head);
        head = bt.addNode(13, head);
        head = bt.addNode(14, head);
        DiameterOfTree dt = new DiameterOfTree();
        System.out.println(dt.diameter(head));
    }
http://www.geeksforgeeks.org/diameter-of-a-binary-tree/
Test cases
All left nodes
All right nodes
src/com/interview/tree/DiameterOfTree.java