Fine-tune code and texts.

This commit is contained in:
krahets
2023-10-27 01:01:21 +08:00
parent 3628b40f44
commit 5b1a219b8b
4 changed files with 7 additions and 11 deletions

View File

@@ -74,12 +74,11 @@ vector<int> treeToVecor(TreeNode *root) {
return res;
}
/* Free the memory allocated to a tree */
/* 释放二叉树内存 */
void freeMemoryTree(TreeNode *root) {
if (root == nullptr)
return;
freeMemoryTree(root->left);
freeMemoryTree(root->right);
// 释放内存
delete root;
}