From 83f87f5e94d70625085c633cbc343b1aeae75318 Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Sun, 22 Nov 2020 15:30:34 +0100 Subject: [PATCH] buffer --- cv8/program.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cv8/program.c b/cv8/program.c index 9abec59..cb04a51 100644 --- a/cv8/program.c +++ b/cv8/program.c @@ -77,7 +77,7 @@ struct tree* find_minimum(struct tree *root){ struct tree* destroy_tree(struct tree* root){ if(root == NULL) return; - /*if(root->left == NULL && root->right == NULL){ + if(root->left == NULL && root->right == NULL){ free(root); return NULL; } @@ -95,7 +95,7 @@ struct tree* destroy_tree(struct tree* root){ struct tree* this = find_minimum(root->left); strcpy(root->value, this->value); root->right = destroy_tree(root->right); - }*/ + } root->left = destroy_tree(root->left); root->right = destroy_tree(root->right); free(root); @@ -142,7 +142,7 @@ int main(){ printf("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.\n"); printf("%s\n", tree->value); tree = search(tree); - destroy_tree(tree); + tree = destroy_tree(tree); printf("Koniec\n"); return 0; }