This commit is contained in:
Maryna Kravtsova 2020-11-22 18:16:42 +01:00
parent c88245fafd
commit 73c5bf6d96

View File

@ -27,20 +27,20 @@ struct tree* read_tree(int* counter){
struct tree* node = calloc(1,sizeof(struct tree));
memcpy(node->value, buffer,50);
*c += 1;
counter = &c;
counter = c;
if(buffer[0] != '*'){
if(node->left == NULL){
node->left = read_tree();
node->left = read_tree(counter);
}
if(node->right == NULL){
node->right = read_tree();
node->right = read_tree(counter);
}
}
if(node->left != NULL && node->right != NULL){
*c -= 2;
counter = &c;
counter = c;
}
if(c == 1){
if(*c == 1){
r = fgets(buffer,50, stdin);
//int x = strlen(buffer);
// buffer[x-1]='\0';