diff --git a/Utilities/BinaryTree.cpp b/Utilities/BinaryTree.cpp index cc8241e..c90b58c 100644 --- a/Utilities/BinaryTree.cpp +++ b/Utilities/BinaryTree.cpp @@ -8,8 +8,8 @@ Distributed under the BSD license. *******************************************************************/ //================================================================== -// 《剑指Offer——名企面试官精讲典型编程题》代码 -// 作者:何海涛 +// 銆婂墤鎸嘜ffer鈥斺斿悕浼侀潰璇曞畼绮捐鍏稿瀷缂栫▼棰樸嬩唬鐮 +// 浣滆咃細浣曟捣娑 //================================================================== #include @@ -72,7 +72,7 @@ void PrintTree(const BinaryTreeNode* pRoot) } } -void DestroyTree(BinaryTreeNode* pRoot) +void DestroyTree(BinaryTreeNode*& pRoot) { if(pRoot != nullptr) { diff --git a/Utilities/BinaryTree.h b/Utilities/BinaryTree.h index 68efc4d..fdd6af1 100644 --- a/Utilities/BinaryTree.h +++ b/Utilities/BinaryTree.h @@ -8,8 +8,8 @@ Distributed under the BSD license. *******************************************************************/ //================================================================== -// 《剑指Offer——名企面试官精讲典型编程题》代码 -// 作者:何海涛 +// 銆婂墤鎸嘜ffer鈥斺斿悕浼侀潰璇曞畼绮捐鍏稿瀷缂栫▼棰樸嬩唬鐮 +// 浣滆咃細浣曟捣娑 //================================================================== #pragma once @@ -25,4 +25,4 @@ __declspec( dllexport ) BinaryTreeNode* CreateBinaryTreeNode(int value); __declspec( dllexport ) void ConnectTreeNodes(BinaryTreeNode* pParent, BinaryTreeNode* pLeft, BinaryTreeNode* pRight); __declspec( dllexport ) void PrintTreeNode(const BinaryTreeNode* pNode); __declspec( dllexport ) void PrintTree(const BinaryTreeNode* pRoot); -__declspec( dllexport ) void DestroyTree(BinaryTreeNode* pRoot); +__declspec( dllexport ) void DestroyTree(BinaryTreeNode*& pRoot);