#76_Insertion in Binary Search Tree
#include <stdio.h> #include <stdlib.h> //Insertion in Binary Search Tree struct node{ int data; struct node * left; struct node * right; }; struct node * create_tree ( int data ){ struct node * n = ( struct node * ) malloc ( sizeof ( struct node)); n->data = data; n->left = n->right = NULL ; return n; } void InOrder ( struct node * root ){ if (root != NULL ){ InOrder (root->left); printf ( " %d " , root->data); InOrder (root->right); } } void insertion_bst ( struct node * root , int key ){ struct node * ptr = root; struct node * prev = NULL ; struct node * new_node = create_tree (key); while (ptr != NULL ){ prev = ptr; if (key == ptr->data){ printf ( " %d is a duplicate ! \n " , key); return ; } if (key < ptr-&g