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) {
|
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(")");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user