✅✔️Easy Implementation using level order Traversal || C++ Solution ✈️✈️✈️✈️✈️
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     TreeNode *left;\n *     TreeNode *right;\n *     TreeNode(int x) : val(x), left(NULL), right(NULL) {}\n * };\n */\nclass Codec {\npublic:\n\n    // Encodes a tree to a single string.\n    string serialize(TreeNode* root) {\n        if(!root) return "";\n        string ans = to_string(root->val) + ",";\n        queue<TreeNode*>q;\n        q.push(root);\n        while(!q.empty()){\n            root = q.front();\n            q.pop();\n            if(root->left){\n                ans += (to_string(root->left->val) + ",");\n                q.push(root->left);\n            } \n            else ans += ("#,");\n            if(root->right){\n                ans += (to_string(root->right->val) + ",");\n                q.push(root->right);\n            }\n            else ans += ("#,"); \n        }\n        return ans;\n    }\n\n    int num(string &data,int &idx){\n        string s = "";\n        while(idx < data.length() && data[idx] != \',\'){\n            s += data[idx];\n            idx++;\n        }\n        idx++;\n        if(s == "#") return -1;\n        return stoi(s);\n    }\n\n    // Decodes your encoded data to tree.\n    TreeNode* deserialize(string data) {\n        if(data.empty()) return NULL;\n        int idx = 0;\n        TreeNode* root = new TreeNode(num(data,idx));\n        queue<TreeNode*>q;\n        q.push(root);\n        while(idx < data.length() && !q.empty()){\n            TreeNode* node = q.front(); q.pop();\n            int left = num(data,idx);\n            int right = num(data,idx);\n            node->left = (left == -1) ? NULL : new TreeNode(left);\n            node->right = (right == -1) ? NULL : new TreeNode(right);\n            if(node->left) q.push(node->left);\n            if(node->right) q.push(node->right);\n        }\n        return root;\n    }\n};\n\n// Your Codec object will be instantiated and called as such:\n// Codec* ser = new Codec();\n// Codec* deser = new Codec();\n// string tree = ser->serialize(root);\n// TreeNode* ans = deser->deserialize(tree);\n// return ans;\n```
['Tree', 'Breadth-First Search', 'Binary Search Tree', 'Binary Tree', 'C++']