buffet
This commit is contained in:
parent
e90255eca1
commit
1c3fdbd255
@ -40,17 +40,18 @@ struct tree* search(struct tree* this){
|
|||||||
|
|
||||||
if(this->left != NULL && this->right != NULL){
|
if(this->left != NULL && this->right != NULL){
|
||||||
if(c == 'a'){
|
if(c == 'a'){
|
||||||
printf("%s\n", this->left);
|
//this->left = search(this->left);
|
||||||
|
printf("%s\n", this->left->value);
|
||||||
this->left = search(this->left);
|
this->left = search(this->left);
|
||||||
}
|
}
|
||||||
else if(c == 'n'){
|
else if(c == 'n'){
|
||||||
printf("%s\n", this->right);
|
//this->right = search(this->right);
|
||||||
|
printf("%s\n", this->right->value);
|
||||||
this->right = search(this->right);
|
this->right = search(this->right);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void destroy_tree(struct tree* root){
|
void destroy_tree(struct tree* root){
|
||||||
if(root == NULL) return;
|
if(root == NULL) return;
|
||||||
|
|
||||||
@ -100,7 +101,7 @@ int main(){
|
|||||||
printf("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.\n");
|
printf("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.\n");
|
||||||
printf("%s\n", tree->value);
|
printf("%s\n", tree->value);
|
||||||
tree = search(tree);
|
tree = search(tree);
|
||||||
destroy_tree(tree);
|
//destroy_tree(tree);
|
||||||
printf("Koniec\n");
|
printf("Koniec\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user