Initializacia
This commit is contained in:
		
							parent
							
								
									42ef7de47e
								
							
						
					
					
						commit
						ca43f2f982
					
				@ -42,13 +42,7 @@ void run_tree(struct tree* tree) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (tree->value[0] == '*') {
 | 
					    if (tree->value[0] == '*') {
 | 
				
			||||||
        // If the node starts with *, check for children
 | 
					        printf("*%s\nKoniec\n", tree->value + 1);
 | 
				
			||||||
        if (tree->left || tree->right) {
 | 
					 | 
				
			||||||
            printf("Expert z bufetu to vie.\nChybna databaza\n");
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
            // If no children, it's the end of a branch
 | 
					 | 
				
			||||||
            printf("*%s\nKoniec\n", tree->value + 1);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -70,7 +64,6 @@ void run_tree(struct tree* tree) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
void destroy_tree(struct tree* tree) {
 | 
					void destroy_tree(struct tree* tree) {
 | 
				
			||||||
    if (tree->left != NULL) {
 | 
					    if (tree->left != NULL) {
 | 
				
			||||||
        destroy_tree(tree->left);
 | 
					        destroy_tree(tree->left);
 | 
				
			||||||
@ -107,4 +100,4 @@ int main() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    destroy_tree(root);
 | 
					    destroy_tree(root);
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user