Compare commits

...

2 Commits

Author SHA1 Message Date
e7a9f798cb add some .o files to gitignore 2025-12-09 09:56:38 +01:00
3a078e9dea working on bintree 2025-12-07 13:13:43 +01:00
2 changed files with 16 additions and 2 deletions

3
.gitignore vendored
View File

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

View File

@ -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.