Perfect Solution - 37915

Solution Posted by
Solution Detail
Price: $60.00
  • From: ,
  • Posted on: Tue 17 Dec, 2013
  • Request id: # 37720
  • Purchased: 0 time(s)
  • Average Rating: No rating
Request Description
Solution Description

Program 

# include <stdio.h>

# include <conio.h>

# include <stdlib.h>

 

typedef struct BST

{

    int data;

    struct BST *lchild,*rchild;

}node;

 

void insert(node *,node *);

void inorder(node *);

void preorder(node *);

void postorder(node *);

node *search(node *,int,node **);

 

void main()

{

 int choice;

 char ans='N';

 int key;

 node *new_node,*root,*tmp,*parent;

 node *get_node();

 root=NULL;

 clrscr();

 

 printf("nProgram For Binary Search Tree ");

 do

 {

   printf("n1.Create");

   printf("n2.Search");

   printf("n3.Recursive Traversals");

   printf("n4.Exit");

   printf("nEnter your choice :");

   scanf("%d",&choice);

 

   switch(choice)

   {

    case 1:

           do

             {

             new_node=get_node();

 

             printf("nEnter The Element ");

             scanf("%d",&new_node->data);

 

             if(root==NULL)   /* Tree is not Created */

                 root=new_node;

             else

                 

Attachments
Binary Tree Programming.txt
Binary Tree Pro...