Python simple, clean and short solution
\nclass Codec:\n    def serialize(self, root: TreeNode) -> str:\n        def encode(root):\n            return "" if not root else str(root.val) + "-" + encode(
```\nclass Codec:\n    def serialize(self, root: TreeNode) -> str:\n        def encode(root):\n            return "" if not root else str(root.val) + "-" + encode(root.left)+encode(root.right)\n\n        return encode(root)\n        \n\n    def deserialize(self, data: str) -> TreeNode:\n        def insert(root, val):\n            if not root:\n                return TreeNode(val)\n\n            if val <= root.val:\n                root.left = insert(root.left,val)\n\n            else:\n                root.right = insert(root.right,val)\n\n            return root\n        \n        root = None\n        my_list = data.split("-")\n        my_list.pop(len(my_list)-1)\n        for item in my_list:\n            root = insert(root, int(item));\n\n        return root;\n```\n**Like it? please upvote...**
['Python']