forked from freudenreichan/info2Praktikum-DobleSpiel
Compare commits
2
Commits
74fdcf500f
...
e7a9f798cb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e7a9f798cb | ||
|
|
3a078e9dea |
No files matched your search
+4
-1
@@ -1,3 +1,6 @@
|
||||
doble_initial.exe
|
||||
*.o
|
||||
*.exe
|
||||
*.exe
|
||||
runTests
|
||||
stack.o
|
||||
test_stack.o
|
||||
@@ -26,7 +26,18 @@ void *nextTreeData(TreeNode *root)
|
||||
// Releases all memory resources (including data copies).
|
||||
void clearTree(TreeNode *root)
|
||||
{
|
||||
|
||||
if(root->right)
|
||||
clearTree(root->right);
|
||||
else if (root->left)
|
||||
clearTree(root->left);
|
||||
else
|
||||
{
|
||||
root->data = 0;
|
||||
free(root->data);
|
||||
free(root->right);
|
||||
free(root->left);
|
||||
free(root);
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the number of entries in the tree given by root.
|
||||
|
||||
Reference in new issue
Block a user