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

No files matched your search

+4 -1
View File
@@ -1,3 +1,6 @@
doble_initial.exe
*.o
*.exe
*.exe
runTests
stack.o
test_stack.o
+12 -1
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.