Fix again prefix/postfix (both were wrong order)

This commit is contained in:
2021-01-25 18:31:01 +01:00
parent 62fbc3fce9
commit b41bf41f56
2 changed files with 5 additions and 3 deletions

4
.gitignore vendored
View File

@@ -3,7 +3,9 @@ com*
ex1*
*.o
perm*
timer
oper
tree
lceb
gmon.out
gmon.out
OUT*

4
tree.c
View File

@@ -72,13 +72,13 @@ void print_node(node, side, depth, details)
} else {
printf("%d ", node->val);
}
print_node(node->right, TREE_RIGHT, depth+1, details);
print_node(node->left, TREE_LEFT, depth+1, details);
print_node(node->right, TREE_RIGHT, depth+1, details);
break;
case 0: /* postfix */
case 5: /* dc suitable */
print_node(node->right, TREE_RIGHT, depth+1, details);
print_node(node->left, TREE_LEFT, depth+1, details);
print_node(node->right, TREE_RIGHT, depth+1, details);
if (node->type==TREE_NODE) {
printf("%c ", node->op);
} else {