Beat 99% 2ms No delimiter(e.g. comma), no stack/queue. Just turn val into char
\npublic class Codec {\n\n    /*\n    max node.val is 10000, less than 6xxxx(max value of char)   \n    So just turn node.val into char.\n    Serialize with pre
```\npublic class Codec {\n\n    /*\n    max node.val is 10000, less than 6xxxx(max value of char)   \n    So just turn node.val into char.\n    Serialize with preorder (parent > left > right)\n    */\n    public String serialize(TreeNode root) {\n        StringBuilder sb = new StringBuilder();\n        helper_serialize(sb, root);\n        return sb.toString();\n    }\n    \n    private void helper_serialize(StringBuilder sb, TreeNode root) {\n        if (root == null) \n            return;\n        sb.append((char)(root.val + \'0\'));\n        helper_serialize(sb, root.left);\n        helper_serialize(sb, root.right);\n    }\n\n    /*\n    it\'s BST, so it\'s already in proper order as long as you add the node in order.\n    */\n    public TreeNode deserialize(String data) {\n        TreeNode root = null;\n        for(char c : data.toCharArray()) {\n            root = add(root, c - \'0\');\n        }\n        return root;\n    }\n    private TreeNode add(TreeNode root, int val) {\n        if (root == null)\n            return new TreeNode(val);\n        \n        if (val < root.val) {\n            root.left = add(root.left, val);\n        } else {\n            root.right = add(root.right, val);\n        }\n        return root;\n    }\n}\n```\n\n\nFYI what char looks like when int is above 9:\n\n```\nint: 5 char: 5\nint: 6 char: 6\nint: 7 char: 7\nint: 8 char: 8\nint: 9 char: 9\nint: 10 char: :\nint: 11 char: ;\nint: 12 char: <\nint: 13 char: =\nint: 14 char: >\nint: 15 char: ?\n```
['Java']