fix infix display (again)

This commit is contained in:
2021-01-25 17:42:45 +01:00
parent 5bd19cbe22
commit 62fbc3fce9

4
tree.c
View File

@@ -109,13 +109,13 @@ void print_node(node, side, depth, details)
if (node->type==TREE_NODE) { if (node->type==TREE_NODE) {
printf("("); printf("(");
} }
print_node(node->right, TREE_RIGHT, depth+1, details); print_node(node->left, TREE_LEFT, depth+1, details);
if (node->type==TREE_NODE) { if (node->type==TREE_NODE) {
printf(" %c ", node->op); printf(" %c ", node->op);
} else { } else {
printf("%d", node->val); printf("%d", node->val);
} }
print_node(node->left, TREE_LEFT, depth+1, details); print_node(node->right, TREE_RIGHT, depth+1, details);
if (node->type==TREE_NODE) { if (node->type==TREE_NODE) {
printf(")"); printf(")");
} }