From 724940804f4cc0fefc3eef232553b0b10d80187d Mon Sep 17 00:00:00 2001 From: Kozar Date: Tue, 12 Nov 2024 13:01:20 +0000 Subject: [PATCH] Initializacia --- cv7/program.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/cv7/program.c b/cv7/program.c index 551776a..657f883 100644 --- a/cv7/program.c +++ b/cv7/program.c @@ -37,18 +37,11 @@ struct tree* load_tree() { return NULL; } - if (node->value[0] != '*') { + if (node->value[0] != '*') { node->left = load_tree(); node->right = load_tree(); - if (!node->left || !node->right) { - destroy_tree(node); - return NULL; - } - } else { - struct tree* extra = read_tree(); - if (extra) { - free(extra); + if (!node->left || !node->right) { destroy_tree(node); return NULL; } @@ -61,7 +54,6 @@ struct tree* load_tree() { - void run_tree(struct tree* tree) { if (!tree) { return; @@ -113,7 +105,7 @@ int main() { struct tree* root = load_tree(); printf("Expert z bufetu to vie.\n"); - if (!root) { + if (!root) { printf("Chybna databaza\n"); return 0; } @@ -129,4 +121,3 @@ int main() { } -