Professional Documents
Culture Documents
Div – C ( CSE-AIML )
Batch – A UID : 2022600007
Program Statement :
Take binary tree as input from user then mirror that binary tree and print.
PROGRAM :
#include <stdio.h>
#include <stdlib.h>
struct node {
int data;
struct node* left, * right;
};
printInorder(node->left);
printf("%d ", node->data);
printInorder(node->right);
}
mirror(root->left);
mirror(root->right);
}
int main() {
struct node* root = NULL;
printf("Creating tree:\n");
root = create();
mirror(root);
return 0;
}
OUTPUT :