Java O(n) recursive DFS without "null" Changed from Serialize and Deserialize BT
Thanks to this post, I realize that I can make use of lower and upper bound.\n\n    // Encodes a tree to a single string.\n    public String serialize(TreeNode 
Thanks to [this post](https://discuss.leetcode.com/topic/66495/using-lower-bound-and-upper-bound-to-deserialize-bst), I realize that I can make use of lower and upper bound.\n\n    // Encodes a tree to a single string.\n    public String serialize(TreeNode root) { // preorder\n        StringBuilder sb = new StringBuilder();\n        serializedfs(root, sb);\n        return sb.toString();\n    }\n    \n    private void serializedfs(TreeNode root, StringBuilder sb){\n        if(root == null) return; // no "null "\n        sb.append(root.val).append(" ");\n        serializedfs(root.left, sb);\n        serializedfs(root.right, sb);\n    }\n\n    // Decodes your encoded data to tree.\n    public TreeNode deserialize(String data) {\n        if(data.length() == 0) return null;\n        String[] list = data.split(" ");\n        TreeNode dummy = new TreeNode(0);\n        deserializedfs(list, 0, dummy, true, Integer.MIN_VALUE, Integer.MAX_VALUE);\n        return dummy.left;\n    }\n    \n    private int deserializedfs(String[] list, int pos, TreeNode par, boolean isleft, \n                                                        int lower, int upper){\n        if(pos >= list.length) return pos;\n    \n        int val = Integer.valueOf(list[pos]);\n        if(val < lower || val > upper) return pos-1; // have not used this pos, so minus one\n        TreeNode cur = new TreeNode(val);\n        \n        if(isleft) par.left = cur;\n        else       par.right = cur;\n\n        pos = deserializedfs(list, ++pos, cur, true, lower, val);\n        pos = deserializedfs(list, ++pos, cur, false, val, upper);\n        return pos;\n    }
[]