private void validateInputTree(BinaryNode root) {
    if (root == null) {
      throw new IllegalArgumentException("You can't pass a null instance of tree to serialize.");
    }
  }
Recursive algorithm based a static index to recreate the original tree properly. The
complexity order of this algorithm is O(N) where N is the number of chars in the input String.
src/main/java/com/github/pedrovgs/problem46/BinaryTreeSerialization.java