From 1c3fdbd255dab0547430bc27dc8d438bef830412 Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Sun, 22 Nov 2020 14:11:47 +0100 Subject: [PATCH] buffet --- cv8/program.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cv8/program.c b/cv8/program.c index c3ac408..21a57e2 100644 --- a/cv8/program.c +++ b/cv8/program.c @@ -40,17 +40,18 @@ struct tree* search(struct tree* this){ if(this->left != NULL && this->right != NULL){ if(c == 'a'){ - printf("%s\n", this->left); + //this->left = search(this->left); + printf("%s\n", this->left->value); this->left = search(this->left); } - else if(c == 'n'){ - printf("%s\n", this->right); + else if(c == 'n'){ + //this->right = search(this->right); + printf("%s\n", this->right->value); this->right = search(this->right); } } } - void destroy_tree(struct tree* root){ if(root == NULL) return; @@ -100,7 +101,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); + //destroy_tree(tree); printf("Koniec\n"); return 0; }