mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-26 02:36:28 +08:00
fix Pointer recycle (#346)
This commit is contained in:
parent
ea901af217
commit
7f4243ab77
2 changed files with 2 additions and 0 deletions
|
@ -120,6 +120,7 @@ public:
|
||||||
cout << "堆的树状表示:" << endl;
|
cout << "堆的树状表示:" << endl;
|
||||||
TreeNode *root = vecToTree(maxHeap);
|
TreeNode *root = vecToTree(maxHeap);
|
||||||
PrintUtil::printTree(root);
|
PrintUtil::printTree(root);
|
||||||
|
freeMemoryTree(root);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -331,5 +331,6 @@ class PrintUtil {
|
||||||
cout << "堆的树状表示:" << endl;
|
cout << "堆的树状表示:" << endl;
|
||||||
TreeNode *root = vecToTree(vec);
|
TreeNode *root = vecToTree(vec);
|
||||||
printTree(root);
|
printTree(root);
|
||||||
|
freeMemoryTree(root);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue