clearTree implemented

This commit is contained in:
lukas committed 2026-11-11 11:18:38 +01:00
1 parent f24ee674ef
commit 6e2987c818
1 file changed
+6 -1
+6 -1
View File
@@ -74,7 +74,12 @@ void *nextTreeData(TreeNode *root)
// Releases all memory resources (including data copies).
void clearTree(TreeNode *root)
{
if(root){
clearTree(root->right);
clearTree(root->left);
free(root->data);
free(root);
}
}
// Returns the number of entries in the tree given by root.