This commit is contained in:
Maryna Kravtsova 2020-11-22 15:29:37 +01:00
parent 64638d2367
commit 32fcfc916a

View File

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