buffet
This commit is contained in:
parent
c88245fafd
commit
73c5bf6d96
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user