fix infix display (again)
This commit is contained in:
4
tree.c
4
tree.c
@@ -109,13 +109,13 @@ void print_node(node, side, depth, details)
|
||||
if (node->type==TREE_NODE) {
|
||||
printf("(");
|
||||
}
|
||||
print_node(node->right, TREE_RIGHT, depth+1, details);
|
||||
print_node(node->left, TREE_LEFT, depth+1, details);
|
||||
if (node->type==TREE_NODE) {
|
||||
printf(" %c ", node->op);
|
||||
} else {
|
||||
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) {
|
||||
printf(")");
|
||||
}
|
||||
|
Reference in New Issue
Block a user