buffet
This commit is contained in:
parent
db45879458
commit
f6e64dc425
@ -18,20 +18,15 @@ struct tree* read_tree(){
|
|||||||
buffer[x-1]='\0';
|
buffer[x-1]='\0';
|
||||||
|
|
||||||
assert(r);
|
assert(r);
|
||||||
if(buffer[0] == '\n'){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(buffer[0] != '\0'){
|
if(buffer[0] != '\0'){
|
||||||
struct tree* node = calloc(1,sizeof(struct tree));
|
struct tree* node = calloc(1,sizeof(struct tree));
|
||||||
memcpy(node->value, buffer,50);
|
memcpy(node->value, buffer,50);
|
||||||
if(buffer[0] != '*'){
|
if(buffer[0] != '*'){
|
||||||
if(node->left == NULL){
|
if(node->left == NULL){
|
||||||
printf("bvbv");
|
|
||||||
node->left = read_tree();
|
node->left = read_tree();
|
||||||
}
|
}
|
||||||
if(node->right == NULL){
|
if(node->right == NULL){
|
||||||
printf("bbdf");
|
|
||||||
node->right = read_tree();
|
node->right = read_tree();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -54,7 +49,7 @@ void search(struct tree* this){
|
|||||||
//buffer[x-1]='\0';
|
//buffer[x-1]='\0';
|
||||||
|
|
||||||
if(buffer[0] == '\n'){
|
if(buffer[0] == '\n'){
|
||||||
return;
|
char* r = fgets(buffer,5,stdin);
|
||||||
}
|
}
|
||||||
if(buffer[0] == 'a'){
|
if(buffer[0] == 'a'){
|
||||||
if(this->left->value[0] == '*'){
|
if(this->left->value[0] == '*'){
|
||||||
|
Loading…
Reference in New Issue
Block a user