This commit is contained in:
Maryna Kravtsova 2020-11-22 14:11:47 +01:00
parent e90255eca1
commit 1c3fdbd255

View File

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