知识点挺多的还,动态数组、层次遍历时区分空与非空节点,字符串的特性 #include <cstdint> class Solution { public: char* Serialize(TreeNode *root) { deque<TreeNode*> workQueue={root}; TreeNode* cur; vector<string> preResult; uint_fast32_t count=0,layerSize=1,nextLayerSize=0; ...