Created
April 22, 2025 14:29
-
-
Save fabianbaechli/4093541670650fe3d7db581004b7e569 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
infix(struct node* p = { | |
if (p ≠ NULL) { | |
if (needParanthesis(p, false)) { | |
printf("("); | |
infix(p->lft); | |
printf(")"); | |
} else { | |
infix(p->lft); | |
} | |
} | |
printf(%c", p->val); | |
if (needParanthesis(p, true) { | |
printf("("); | |
infix(p->rgt); | |
printf(")"); | |
} else { | |
infix(p->rgt); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment