// Decodes your encoded data to tree. TreeNode* deserialize(string data){ tmp = data; return de_dfs(); }
TreeNode* de_dfs(){ int index = tmp.find(","); string cur = ""; if (index > -1) { cur = tmp.substr(0, index); tmp.erase(0, index + 1); } else { //if the last string is not end with "," cur = tmp; }