TRAVERSALS #include<stdio.h> #include<conio.h> typedef struct node { int data; struct node*left; struct node*right; }tree; tree* createtree(); tree* insert(tree*,tree*); void preorder(tree*); void inorder(tree*); void postorder(tree*); void main() { int ch; tree*bt; clrscr(); bt=createtree(); printf("\n \tBINARY TREE TRAVERSAL \n"); printf("\n \t1.traversals \n"); printf("\n \t2.exit\n"); printf("\n \tenter your choice \n"); scanf("%d",&ch); if(bt==NULL) { printf("\nbinary tree is empty\n"); return; } switch(ch) { case 1: printf("\n \t preorder traversal \n"); preorder(bt); printf("\n \t inorder traversal \n"); inorder(bt); printf("\n \t postorder traversal \n"); postorder(bt); break; case 2: printf("\n exit"); exit(0); } getch(); free(bt); } tree* createtree() { char ch; t...
Its all about Network Simulations (NS2, NS3), Internet of Things, Sensor Networks, Programming, Embedded Systems, Cyber Physical Systems, etc