Initializacia
This commit is contained in:
parent
8b105891e8
commit
ddfa832899
@ -20,15 +20,16 @@ struct tree* read_tree(){
|
|||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct tstruct tree* load_tree() {
|
struct tree* load_tree() {
|
||||||
struct tree* tree = read_tree();
|
struct tree* node = read_tree();
|
||||||
|
if (!node) {
|
||||||
tree->left = load_tree();
|
return NULL;
|
||||||
tree->right = load_tree();
|
|
||||||
|
|
||||||
if (tree->value[0] == "*"){
|
|
||||||
re
|
|
||||||
}
|
}
|
||||||
|
if (node->value[0] != '*') {
|
||||||
|
node->left = load_tree();
|
||||||
|
node->right = load_tree();
|
||||||
|
}
|
||||||
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_tree(struct tree* tree,int offset){
|
void print_tree(struct tree* tree,int offset){
|
||||||
@ -61,11 +62,3 @@ void count_items(struct tree* tree, int* count){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
|
||||||
printf("Constructing the tree:\n");
|
|
||||||
struct tree* root = test();
|
|
||||||
printf("The tree structure:\n");
|
|
||||||
print_tree(root, 0);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user