du6 - 19
This commit is contained in:
parent
c2a3eb71a0
commit
6dfe6ba2bc
@ -45,9 +45,8 @@ void destroy_tree(Tree *tree) {
|
||||
|
||||
int count_leaves(Tree *tree) {
|
||||
if (!tree) return 0;
|
||||
if (!tree->left && !tree->right)
|
||||
return 1;
|
||||
return count_leaves(t->left) + count_leaves(t->right);
|
||||
if (!tree->left && !tree->right) return 1;
|
||||
return count_leaves(tree->left) + count_leaves(tree->right);
|
||||
}
|
||||
|
||||
// spustenie znalostneho systemu
|
||||
|
||||
Loading…
Reference in New Issue
Block a user