Compare commits
No commits in common. "e7a9f798cb43c262dd5ac6def04912ce620ecc56" and "74fdcf500f907e4b41e04821da24466a54a00897" have entirely different histories.
e7a9f798cb
...
74fdcf500f
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,6 +1,3 @@
|
|||||||
doble_initial.exe
|
doble_initial.exe
|
||||||
*.o
|
*.o
|
||||||
*.exe
|
*.exe
|
||||||
runTests
|
|
||||||
stack.o
|
|
||||||
test_stack.o
|
|
||||||
|
|||||||
13
bintree.c
13
bintree.c
@ -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.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user