This commit is contained in:
Radovan Kofira 2020-11-19 19:03:55 +01:00
parent 2311c7561c
commit 7109aca512

View File

@ -6,20 +6,19 @@
#define SIZE 100 #define SIZE 100
struct tree { struct tree {
char question[SIZE];
//otazka ab. odpoved //otazka ab. odpoved
char value[SIZE]; char value[SIZE];
// Odpoveď áno // Odpoveï áno
struct tree* left; struct tree* left;
// Odpoveď nie // Odpoveï nie
struct tree* right; struct tree* right;
}; }tree;
void print_tree(struct node* tree,int offset){ void print_tree(struct tree* tree,int offset){
for (int i = 0; i < offset; i++){ for (int i = 0; i < offset; i++){
printf(" "); printf(" ");
} }
printf("%s",tree->question); printf("%s",tree->value);
if (tree->left){ if (tree->left){
print_tree(tree->left,offset +3); print_tree(tree->left,offset +3);
print_tree(tree->right,offset +3); print_tree(tree->right,offset +3);
@ -61,4 +60,4 @@ while (si >= 0){
} }
si = si -1;*/ si = si -1;*/
return 0; return 0;
} }