public String serialize(BinaryNode root) {
    validateInputTree(root);
    return serializeInner(root);
  }
Recursive algorithm based on a pre order traversal of the tree to generate an string with the
content of the tree and # for every leaf. The complexity order of this algorithm is O(N) where
N is the number of nodes in the tree.
src/main/java/com/github/pedrovgs/problem46/BinaryTreeSerialization.java