Initializacia
This commit is contained in:
parent
2da0b7a3e5
commit
b701fb7fdc
@ -32,10 +32,16 @@ struct tree* load_tree() {
|
|||||||
if (node->value[0] != '*') {
|
if (node->value[0] != '*') {
|
||||||
node->left = load_tree();
|
node->left = load_tree();
|
||||||
node->right = load_tree();
|
node->right = load_tree();
|
||||||
|
|
||||||
|
if (!node->left || !node->right) {
|
||||||
|
destroy_tree(node);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void run_tree(struct tree* tree) {
|
void run_tree(struct tree* tree) {
|
||||||
if (!tree) {
|
if (!tree) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user