# 10968 - Prefix to infix >author: Utin ###### tags: `binary tree` --- ## Brief See the code below ## Solution 0 ```c= #ifndef FUNCTION_H #define FUNCTION_H #include <stdio.h> typedef struct treeNode { char data; struct treeNode *left; struct treeNode *right; } Node; void constructTree(Node** head); void printInfix(Node *root) { if (root->left) printInfix(root->left); printf("%c", root->data); if (root->right) { if (root->right->data == '|' || root->right->data == '&') printf("("); printInfix(root->right); if (root->right->data == '|' || root->right->data == '&') printf(")"); } } void freeTree(Node *root); #endif // By Utin ``` ## Reference
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up