From 9bc82f2b39a6adbc3541717981c962843ad713a5 Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Sun, 22 Nov 2020 16:29:45 +0100 Subject: [PATCH] buffet --- cv8/program.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/cv8/program.c b/cv8/program.c index 4a60e13..242000a 100644 --- a/cv8/program.c +++ b/cv8/program.c @@ -42,12 +42,12 @@ void search(struct tree* this){ int x = strlen(buffer); buffer[x-1]='\0'; - /*if(this == NULL){ + if(buffer[0] == '\n'){ return; - } */ + } if(buffer[0] == 'a'){ - if(this->value[0] == '*'){ - printf("%s\n", this->value); + if(this->left->value[0] == '*'){ + printf("%s\n", this->left->value); return; } printf("%s\n", this->left->value); @@ -78,17 +78,6 @@ void print_tree(struct tree* tree,int offset){ } } -struct tree* find_minimum(struct tree *root){ - if(root == NULL){ - return NULL; - } - else if(root->left != NULL){ - return find_minimum(root->left); - } - return root; -} - - void destroy_tree(struct tree* root){ if(root == NULL) return;