private void populate(Node root, NodeRef nodeRef){
        if(root == null){
            return;
        }
        populate(root.right,nodeRef);
        root.next = nodeRef.node;
        nodeRef.node = root;
        populate(root.left,nodeRef);
    }
http://www.geeksforgeeks.org/populate-inorder-successor-for-all-nodes/
src/com/interview/tree/PopulateInOrderSuccessor.java