Compare commits

..

No commits in common. "e7a9f798cb43c262dd5ac6def04912ce620ecc56" and "74fdcf500f907e4b41e04821da24466a54a00897" have entirely different histories.

2 changed files with 2 additions and 16 deletions

5
.gitignore vendored
View File

@ -1,6 +1,3 @@
doble_initial.exe doble_initial.exe
*.o *.o
*.exe *.exe
runTests
stack.o
test_stack.o

View File

@ -26,18 +26,7 @@ void *nextTreeData(TreeNode *root)
// Releases all memory resources (including data copies). // Releases all memory resources (including data copies).
void clearTree(TreeNode *root) 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. // Returns the number of entries in the tree given by root.