public static void main(String args[]){
        BinaryTree bt = new BinaryTree();
        Node root = null;
        root = bt.addNode(10, root);
        root = bt.addNode(15, root);
        root = bt.addNode(5, root);
        root = bt.addNode(7, root);
        root = bt.addNode(19, root);
        root = bt.addNode(20, root);
        root = bt.addNode(-1, root);
        root = bt.addNode(21, root);
        ConnectNodesAtSameLevel cns = new ConnectNodesAtSameLevel();

        cns.connect(root);
    }
Date 03/24/2016
@author Tushar Roy

Populate next pointer for each node of binary tree.

Time complexity O(n)
Space complexity O(1)

https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/
src/com/interview/tree/ConnectNodesAtSameLevel.java