Implementation of Binary Search Tree using C Programming Language
#include <stdio.h> #include <conio.h> #include <alloc.h> struct node { int data ; struct node * left ; struct node * right ; }* root = NULL ; void bstinsert ( int d , struct node * r ){ struct node * temp ; if ( r == NULL ){ temp =( struct node * ) malloc ( sizeof (struct node )); temp -> data = d ; temp -> left = NULL ; temp -> right = NULL ; root = temp ; } else if ( d < r -> data ){ if ( r -> left == NULL ){ struct node * temp =( struct node * ) malloc ( sizeof (struct node )); temp -> data = d ; temp -> left = NUL...
Comments
Post a Comment