private void encode(Node root, Result r) {
        if(root == null) {
            r.binaryRep.add(0);
            return;
        }
        r.actualData.add(root.data);
        r.binaryRep.add(1);

        encode(root.left, r);
        encode(root.right, r);
    }
Date 11/01/2015
 @author Tushar

 Encode and decode binary tree using succinct encoding technique

References - http://www.geeksforgeeks.org/succinct-encoding-of-binary-tree/
https://en.wikipedia.org/wiki/Binary_tree#Succinct_encodings
src/com/interview/tree/SuccinctTree.java