private static TreeNode deserialize(String[] tokens){
        if(index >= tokens.length || tokens[index].equals("#")){
            index++;
            return null;
        }
        TreeNode root = new TreeNode(Integer.parseInt(tokens[index++]));
        root.left = deserialize(tokens);
        root.right = deserialize(tokens);
        return root;
    }