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; }