SlideShare ist ein Scribd-Unternehmen logo
1 von 113
#include<stdio.h>                             printf("n***MENU***");
#include<conio.h>                             printf("n1.CREATEn2.PRE-ORDER");
#include<alloc.h>                             printf("n3.IN-ORDERn4.POST-
void create(struct node *);                   ORDERn5.EXIT");
void in_order();                              printf("nPLease Enter the Choice...");
void pre_order();                             scanf("%d",&ch);
void post_order();                            switch(ch)
struct node                                   {
{                                                    case 1:root=NULL;
     int data;                                           create(root);break;
     struct node *left,*right;                       case 2:pre_order();break;
}*root=NULL,*New,*temp,*p,*stack[20];                case 3:in_order();break;
int top=-1,flag[20],item;                            case 4:post_order();break;
char c;                                              case 5:exit(0);
                                                     default: printf("nInvalid choice...");
void main()                                   }
{                                           }while(ch!=5);
   int ch,e;                                getch();
   clrscr();                            }
   do
   {
void create(struct node *t) t = NULL                New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)//Is It first node?
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ",t->data);            if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("nDo you want add Another(y/n)...");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);
     }                                          }
  }                                            }
  else
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)//Is It first node?
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ",t->data);            if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("nDo you want add Another(y/n)...");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);
     }                                          }
  }                                            }
  else
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)//Is It first node?
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ",t->data);            if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("nDo you want add Another(y/n)...");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);                        New
     }                                          }
  }                                            }
  else
{ New=(struct node *) malloc (sizeof
     (struct node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);           100
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ",t->data);            if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("nDo you want add Another(y/n)...");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100     New
     }                                          }
  }                                            }
  else
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ",t->data);            if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("nDo you want add Another(y/n)...");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        New
     }                                          }
  }                                            }
  else
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ",t->data);            if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("nDo you want add Another(y/n)...");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        New
     }                                          }                                     root
  }                                            }
  else
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ",t->data);            if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);            y
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        New
     }                                          }                                     root
  }                                            }
  else
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ",t->data);            if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        New
     }                                          }                                     root
  }                                            }
  else
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t) t = 100                 New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ",t->data);            if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }
  }                                            }
  else
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = 100              New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ",t->data);            if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }
  }                                            }
  else
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = 100              New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ",t->data);            if(c=='l' || c=='L‘)
     scanf("%c",&c);          l                       s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }
  }                                            }
  else
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = 100              New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }
  }                                            }
  else
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = 100              New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }                                     s
  }                                            }
  else
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t) t = NULL                New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }                                     s
  }                                            }
  else
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }                                     s
  }                                            }
  else
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);           50
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100     root
     }                                          }                                  s
  }                                            }
  else                                                                     50      New
{ New=(struct node *) malloc (sizeof
     (struct node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }                                     s
  }                                            }
  else                                                                     50         New
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }                                     s
  }                                            }
  else                                                                     50         New
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }                                     s
  }                                            }
  else                                                                50       New
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);            y
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }
  }                                            }
  else                                                                50
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }
  }                                            }
  else                                                                50
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t) t = 100                 New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }
  }                                            }
  else                                                                50
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = 100              New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }
  }                                            }
  else                                                                50
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = 100              New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);          r                       s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }
  }                                            }
  else                                                                50
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = 100              New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }
  }                                            }
  else                                                                50
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = 100              New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }                                     s
  }                                            }
  else                                                                50
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t) t = NULL                New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }                                     s
  }                                            }
  else                                                                50
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }                                     s
  }                                            }
  else                                                                50
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);           60
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100     root
     }                                          }                                  s
  }                                            }
  else                                                                50       60    New
{ New=(struct node *) malloc (sizeof
     (struct node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }                                     s
  }                                            }
  else                                                                50       60       New
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }                                     s
  }                                            }
  else                                                               50        60       New
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }                                     s
  }                                            }
  else                                                                50       60          New
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);            n
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }                                     s
  }                                            }
  else                                                                50       60          New
{ New=(struct node *) malloc (sizeof (struct
     node));
void create(struct node *t)    t = NULL             New->left=New->right=NULL;
{                                                   printf("nEnter the Element...");
  char ch;                                          scanf("%d",&New->data);
  struct node *s;                                   if(root==NULL)
  if(t!=NULL)                                       root=New;
  {                                                 else
     printf("nWhether you want to insert at        {
     Left or Rigth( L/R) of %d ", t->data);           if(c=='l' || c=='L‘)
     scanf("%c",&c);                                  s->left=New;
     if(c=='l'|| c=='L‘)                            else
     {                                              s->right=New;
       s=t; create(t->left);                        }
     }                                           printf("Do you want add Another (y/n)");
     else                                        scanf("%c",&ch);
     {                                           if(ch=='y')
       s=t; create(t->right);                    create(root);             100        root
     }                                          }
  }                                            }
  else                                                                50       60
{ New=(struct node *) malloc (sizeof (struct
     node));
void in_order()                                             printf("%d ",p->data);
{                                                           p=p->right;
   int finish=0;                                      }
   if(root==NULL)                                     else
   {                                                  finish=1;
          printf("nTree is Empty...");return;       }while(finish==0);
   }                                             }                                100             root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                 50              60
   do
   {
      while(p!=NULL)
     {                                                             4
          stack[++top]=p;                                          3
          p=p->left;                                               2
   }                                                               1
   if(top!=0)                                                      0
   {                                                                           top = -1        finish = 0
          p=stack[top];
          top--;
void in_order()                                             printf("%d ",p->data);
{                                                           p=p->right;
   int finish=0;                                      }
   if(root==NULL)                                     else
   {                                                  finish=1;
          printf("nTree is Empty...");return;       }while(finish==0);
   }                                             }                              100           root
   stack[++top]=NULL;                                                                         p
   p=root;
   printf("nInorder Traversal is...n");                                 50          60
   do
   {
      while(p!=NULL)
     {                                                           4
          stack[++top]=p;                                        3
          p=p->left;                                             2
   }                                                             1
   if(top!=0)                                               top 0             NULL
   {                                                                                       finish = 0
          p=stack[top];
          top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;                                                                          p
   p=root;
   printf("nInorder Traversal is...n");                                  50          60
   do
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                             2
     }                                                            1
     if(top!=0)                                               top0             NULL
    {                                                                                       finish = 0
           p=stack[top];
           top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                       p          50          60
   do
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                             2
     }                                                        top1              100
     if(top!=0)                                                   0             NULL
    {                                                                                       finish = 0
           p=stack[top];
           top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                       p          50          60
   do
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                             2
     }                                                        top1              100
     if(top!=0)                                                   0             NULL
    {
           p=stack[top];                                                                    finish = 0
           top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                  50          60
   do                                                        p     NULL
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                         top2               50
     }                                                            1              100
     if(top!=0)                                                   0             NULL
    {                                                                                       finish = 0
           p=stack[top];
           top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                  50          60
   do                                                        p     NULL
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                         top2               50
     }                                                            1              100
     if(top!=0)                                                   0             NULL
    {                                                                                       finish = 0
           p=stack[top];
           top--;
void in_order()                                             printf("%d ",p->data);
{                                                           p=p->right;
   int finish=0;                                      }
   if(root==NULL)                                     else
   {                                                  finish=1;
          printf("nTree is Empty...");return;       }while(finish==0);
   }                                             }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                 50          60
   do                                                       p     NULL
   {
      while(p!=NULL)
     {                                                           4
          stack[++top]=p;                                        3
          p=p->left;                                         top2               50
     }                                                           1              100
     if(top!=0)                                                  0             NULL
    {                                                                                      finish = 0
          p=stack[top];
          top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                        p         50          60
   do
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                             2
     }                                                        top1              100
     if(top!=0)                                                   0             NULL
    {                                                                                       finish = 0
           p=stack[top];
           top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                  50          60
   do                                                         p    NULL
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                             2
     }                                                        top1              100
     if(top!=0)                                                   0             NULL
    {                                                                                       finish = 0
           p=stack[top];                          50         100
           top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                  50          60
   do                                                         p    NULL
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                             2
     }                                                        top1              100
     if(top!=0)                                                   0             NULL
    {                                                                                       finish = 0
           p=stack[top];                          50         100
           top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                  50          60
   do                                                         p    NULL
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                             2
     }                                                        top1              100
     if(top!=0)                                                   0             NULL
    {                                                                                       finish = 0
           p=stack[top];                          50         100
           top--;
void in_order()                                             printf("%d ",p->data);
{                                                           p=p->right;
   int finish=0;                                      }
   if(root==NULL)                                     else
   {                                                  finish=1;
          printf("nTree is Empty...");return;       }while(finish==0);
   }                                             }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                 50          60
   do                                                        p    NULL
   {
      while(p!=NULL)
     {                                                           4
          stack[++top]=p;                                        3
          p=p->left;                                             2
     }                                                       top1              100
     if(top!=0)                                                  0             NULL
    {                                                                                      finish = 0
          p=stack[top];                          50         100
          top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;                                                                          p
   p=root;
   printf("nInorder Traversal is...n");                                  50          60
   do
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                             2
     }                                                            1
     if(top!=0)                                               top0             NULL
    {                                                                                       finish = 0
           p=stack[top];                          50         100
           top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                  50          60          p
   do
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                             2
     }                                                            1
     if(top!=0)                                               top0             NULL
    {                                                                                       finish = 0
           p=stack[top];                          50         100
           top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                  50          60          p
   do
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                             2
     }                                                            1
     if(top!=0)                                               top0             NULL
    {                                                                                       finish = 0
           p=stack[top];                          50         100
           top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                  50          60          p
   do
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                             2
     }                                                            1
     if(top!=0)                                               top0             NULL
    {                                                                                       finish = 0
           p=stack[top];                          50         100
           top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                  50          60
   do                                                         p    NULL
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                             2
     }                                                        top1              60
     if(top!=0)                                                   0             NULL
    {                                                                                       finish = 0
           p=stack[top];                          50         100
           top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                  50          60
   do                                                         p    NULL
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                             2
     }                                                        top1              60
     if(top!=0)                                                   0             NULL
    {                                                                                       finish = 0
           p=stack[top];                          50         100
           top--;
void in_order()                                             printf("%d ",p->data);
{                                                           p=p->right;
   int finish=0;                                      }
   if(root==NULL)                                     else
   {                                                  finish=1;
          printf("nTree is Empty...");return;       }while(finish==0);
   }                                             }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                 50          60
   do                                                        p    NULL
   {
      while(p!=NULL)
     {                                                           4
          stack[++top]=p;                                        3
          p=p->left;                                             2
     }                                                       top1              60
     if(top!=0)                                                  0             NULL
    {                                                                                      finish = 0
          p=stack[top];                          50         100
          top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                  50          60          p
   do
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                             2
     }                                                            1
     if(top!=0)                                               top0             NULL
    {                                                                                       finish = 0
           p=stack[top];                          50         100
           top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                  50          60
   do                                                        p     NULL
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                             2
     }                                                            1
     if(top!=0)                                               top0             NULL
    {                                                                                       finish = 0
           p=stack[top];                          50         100       60
           top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                  50          60
   do                                                        p     NULL
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                             2
     }                                                            1
     if(top!=0)                                               top0             NULL
    {                                                                                       finish = 0
           p=stack[top];                          50         100      60
           top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                  50          60
   do                                                        p     NULL
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                             2
     }                                                            1
     if(top!=0)                                               top0             NULL
    {                                                                                       finish = 0
           p=stack[top];                          50         100       60
           top--;
void in_order()                                             printf("%d ",p->data);
{                                                           p=p->right;
   int finish=0;                                      }
   if(root==NULL)                                     else
   {                                                  finish=1;
          printf("nTree is Empty...");return;       }while(finish==0);
   }                                             }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                 50          60
   do                                                       p     NULL
   {
      while(p!=NULL)
     {                                                           4
          stack[++top]=p;                                        3
          p=p->left;                                             2
     }                                                           1
     if(top!=0)                                              top0             NULL
    {                                                                                      finish = 0
          p=stack[top];                          50         100       60
          top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                  50          60
   do                                                        p     NULL
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                             2
     }                                                            1
     if(top!=0)                                               top0             NULL
    {                                                                                       finish = 1
           p=stack[top];                          50         100       60
           top--;
void in_order()                                              printf("%d ",p->data);
{                                                            p=p->right;
   int finish=0;                                       }
   if(root==NULL)                                      else
   {                                                   finish=1;
           printf("nTree is Empty...");return;       }while(finish==0);
   }                                              }                              100           root
   stack[++top]=NULL;
   p=root;
   printf("nInorder Traversal is...n");                                  50          60
   do                                                        p     NULL
   {
      while(p!=NULL)
     {                                                            4
           stack[++top]=p;                                        3
           p=p->left;                                             2
     }                                                            1
     if(top!=0)                                               top0             NULL
    {                                                                                       finish = 1
           p=stack[top];                          50         100      60
           top--;
void pre_order()
{
  if(root==NULL)
  {
     printf("nTree is Empty...");
     return;
  }                                                     100            root
  stack[++top]=NULL;
  p=root;
  printf("nPreorder Traversal is...n");       50              60
  while(p!=NULL)
  {
     printf("%d ",p->data);
     if(p->right!=NULL)                     4
     stack[++top]=p->right;                 3
     if(p->left!=NULL)                      2
     p=p->left;                             1
     else                                   0
     p=stack[top--];                                 top = -1        finish = 0
  }
}
void pre_order()
{
  if(root==NULL)
  {
     printf("nTree is Empty...");
     return;
  }                                                       100        root
  stack[++top]=NULL;                                                  p
  p=root;
  printf("nPreorder Traversal is...n");           50          60
  while(p!=NULL)
  {
     printf("%d ",p->data);
     if(p->right!=NULL)                         4
     stack[++top]=p->right;                     3
     if(p->left!=NULL)                          2
     p=p->left;                                 1
     else                                   top0        NULL
     p=stack[top--];
  }
}
void pre_order()
{
  if(root==NULL)
  {
     printf("nTree is Empty...");
     return;
  }                                                       100        root
  stack[++top]=NULL;                                                  p
  p=root;
  printf("nPreorder Traversal is...n");           50          60
  while(p!=NULL)
  {
     printf("%d ",p->data);
     if(p->right!=NULL)                         4
     stack[++top]=p->right;                     3
     if(p->left!=NULL)                          2
     p=p->left;                                 1
     else                                   top0        NULL
     p=stack[top--];
  }
}
void pre_order()
{
  if(root==NULL)
  {
     printf("nTree is Empty...");
     return;
  }                                                             100        root
  stack[++top]=NULL;                                                        p
  p=root;
  printf("nPreorder Traversal is...n");                 50          60
  while(p!=NULL)
  {
     printf("%d ",p->data);
     if(p->right!=NULL)                               4
     stack[++top]=p->right;                           3
     if(p->left!=NULL)                                2
     p=p->left;                                       1
     else                                         top0        NULL
     p=stack[top--];
  }                                         100
}
void pre_order()
{
  if(root==NULL)
  {
     printf("nTree is Empty...");
     return;
  }                                                             100        root
  stack[++top]=NULL;                                                        p
  p=root;
  printf("nPreorder Traversal is...n");                 50          60
  while(p!=NULL)
  {
     printf("%d ",p->data);
     if(p->right!=NULL)                               4
     stack[++top]=p->right;                           3
     if(p->left!=NULL)                                2
     p=p->left;                                       1
     else                                         top0        NULL
     p=stack[top--];
  }                                         100
}
void pre_order()
{
  if(root==NULL)
  {
     printf("nTree is Empty...");
     return;
  }                                                             100        root
  stack[++top]=NULL;                                                        p
  p=root;
  printf("nPreorder Traversal is...n");                 50          60
  while(p!=NULL)
  {
     printf("%d ",p->data);
     if(p->right!=NULL)                               4
     stack[++top]=p->right;                           3
     if(p->left!=NULL)                                2
     p=p->left;                                   top1         60
     else                                             0        NULL
     p=stack[top--];
  }                                         100
}
void pre_order()
{
  if(root==NULL)
  {
     printf("nTree is Empty...");
     return;
  }                                                             100        root
  stack[++top]=NULL;                                                        p
  p=root;
  printf("nPreorder Traversal is...n");                 50          60
  while(p!=NULL)
  {
     printf("%d ",p->data);
     if(p->right!=NULL)                               4
     stack[++top]=p->right;                           3
     if(p->left!=NULL)                                2
     p=p->left;                                   top1         60
     else                                             0        NULL
     p=stack[top--];
  }                                         100
}
void pre_order()
{
  if(root==NULL)
  {
     printf("nTree is Empty...");
     return;
  }                                                             100        root
  stack[++top]=NULL;
  p=root;
  printf("nPreorder Traversal is...n");           p     50          60
  while(p!=NULL)
  {
     printf("%d ",p->data);
     if(p->right!=NULL)                               4
     stack[++top]=p->right;                           3
     if(p->left!=NULL)                                2
     p=p->left;                                   top1         60
     else                                             0        NULL
     p=stack[top--];
  }                                         100
}
void pre_order()
{
  if(root==NULL)
  {
     printf("nTree is Empty...");
     return;
  }                                                             100        root
  stack[++top]=NULL;
  p=root;
  printf("nPreorder Traversal is...n");           p     50          60
while(p!=NULL)
{
     printf("%d ",p->data);
     if(p->right!=NULL)                               4
     stack[++top]=p->right;                           3
     if(p->left!=NULL)                                2
     p=p->left;                                   top1         60
     else                                             0        NULL
     p=stack[top--];
  }                                         100
}
void pre_order()
{
  if(root==NULL)
  {
     printf("nTree is Empty...");
     return;
  }                                                              100        root
  stack[++top]=NULL;
  p=root;
  printf("nPreorder Traversal is...n");              p   50          60
while(p!=NULL)
{
     printf("%d ",p->data);
     if(p->right!=NULL)                               4
     stack[++top]=p->right;                           3
     if(p->left!=NULL)                                2
     p=p->left;                                   top1          60
     else                                             0         NULL
     p=stack[top--];
  }                                         100   50
}
void pre_order()
{
  if(root==NULL)
  {
     printf("nTree is Empty...");
     return;
  }                                                              100        root
  stack[++top]=NULL;
  p=root;
  printf("nPreorder Traversal is...n");              p   50          60
while(p!=NULL)
{
     printf("%d ",p->data);
     if(p->right!=NULL)                               4
     stack[++top]=p->right;                           3
     if(p->left!=NULL)                                2
     p=p->left;                                   top1          60
     else                                             0         NULL
     p=stack[top--];
  }                                         100   50
}
void pre_order()
{
  if(root==NULL)
  {
     printf("nTree is Empty...");
     return;
  }                                                             100        root
  stack[++top]=NULL;
  p=root;
  printf("nPreorder Traversal is...n");                 50          60          p
while(p!=NULL)
{
     printf("%d ",p->data);
     if(p->right!=NULL)                               4
     stack[++top]=p->right;                           3
     if(p->left!=NULL)                                2
     p=p->left;                                       1
     else                                         top0        NULL
     p=stack[top--];
  }                                         100   50
}
void pre_order()
{
  if(root==NULL)
  {
     printf("nTree is Empty...");
     return;
  }                                                             100        root
  stack[++top]=NULL;
  p=root;
  printf("nPreorder Traversal is...n");                 50          60          p
while(p!=NULL)
{
     printf("%d ",p->data);
     if(p->right!=NULL)                               4
     stack[++top]=p->right;                           3
     if(p->left!=NULL)                                2
     p=p->left;                                       1
     else                                         top0        NULL
     p=stack[top--];
  }                                         100   50
}
void pre_order()
{
  if(root==NULL)
  {
     printf("nTree is Empty...");
     return;
  }                                                              100        root
  stack[++top]=NULL;
  p=root;
  printf("nPreorder Traversal is...n");                  50          60          p
while(p!=NULL)
{
     printf("%d ",p->data);
     if(p->right!=NULL)                               4
     stack[++top]=p->right;                           3
     if(p->left!=NULL)                                2
     p=p->left;                                       1
     else                                         top0         NULL
     p=stack[top--];
  }                                         100   50      60
}
void pre_order()
{
  if(root==NULL)
  {
     printf("nTree is Empty...");
     return;
  }                                                              100        root
  stack[++top]=NULL;
  p=root;
  printf("nPreorder Traversal is...n");                  50          60          p
while(p!=NULL)
{
     printf("%d ",p->data);
     if(p->right!=NULL)                               4
     stack[++top]=p->right;                           3
     if(p->left!=NULL)                                2
     p=p->left;                                       1
     else                                         top0         NULL
     p=stack[top--];
  }                                         100   50      60
}
void pre_order()
{
  if(root==NULL)
  {
     printf("nTree is Empty...");
     return;
  }                                                                100        root
  stack[++top]=NULL;
  p=root;
  printf("nPreorder Traversal is...n");                   50           60
while(p!=NULL)                                    p    NULL
{
     printf("%d ",p->data);
     if(p->right!=NULL)                                4
     stack[++top]=p->right;                            3
     if(p->left!=NULL)                                 2
     p=p->left;                                        1
     else                                              0
     p=stack[top--];                                             top = -1
  }                                         100   50       60
}
void pre_order()
{
  if(root==NULL)
  {
     printf("nTree is Empty...");
     return;
  }                                                                100        root
  stack[++top]=NULL;
  p=root;
  printf("nPreorder Traversal is...n");                   50           60
while(p!=NULL)                                    p    NULL
{
     printf("%d ",p->data);
     if(p->right!=NULL)                                4
     stack[++top]=p->right;                            3
     if(p->left!=NULL)                                 2
     p=p->left;                                        1
     else                                              0
     p=stack[top--];                                             top = -1
  }                                         100   50       60
}
void post_order()
{
  int f;
  if(root==NULL)
  {
    printf("nTree is Empty...");
    return;                                            100          root
  }

 stack[++top]=NULL;                              50            60
 p=root;

 printf("nPostorder Traversal is...n");
                                            4              4
                                            3              3
                                            2              2
                                            1              1
                                            0              0
                                                top = -1
void post_order()
{
  int f;
  if(root==NULL)
  {
    printf("nTree is Empty...");
    return;                                           100         root
  }                                                                p

 stack[++top]=NULL;                             50          60
 p=root;

 printf("nPostorder Traversal is...n");
                                            4          4
                                            3          3
                                            2          2
                                            1          1
                                            0   top    0         NULL
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree
Binary tree

Weitere ähnliche Inhalte

Was ist angesagt? (20)

Double linked list
Double linked listDouble linked list
Double linked list
 
Datastructures asignment
Datastructures asignmentDatastructures asignment
Datastructures asignment
 
C lab manaual
C lab manaualC lab manaual
C lab manaual
 
Circular linked list
Circular linked listCircular linked list
Circular linked list
 
Cpds lab
Cpds labCpds lab
Cpds lab
 
Single linked list
Single linked listSingle linked list
Single linked list
 
week-16x
week-16xweek-16x
week-16x
 
Numerical Methods in C
Numerical Methods in CNumerical Methods in C
Numerical Methods in C
 
C Prog. - Strings (Updated)
C Prog. - Strings (Updated)C Prog. - Strings (Updated)
C Prog. - Strings (Updated)
 
Pnno
PnnoPnno
Pnno
 
All important c programby makhan kumbhkar
All important c programby makhan kumbhkarAll important c programby makhan kumbhkar
All important c programby makhan kumbhkar
 
C basics
C basicsC basics
C basics
 
DAA Lab File C Programs
DAA Lab File C ProgramsDAA Lab File C Programs
DAA Lab File C Programs
 
C Prog - Array
C Prog - ArrayC Prog - Array
C Prog - Array
 
design and analysis of algorithm Lab files
design and analysis of algorithm Lab filesdesign and analysis of algorithm Lab files
design and analysis of algorithm Lab files
 
c-programming-using-pointers
c-programming-using-pointersc-programming-using-pointers
c-programming-using-pointers
 
C programming array & shorting
C  programming array & shortingC  programming array & shorting
C programming array & shorting
 
C programms
C programmsC programms
C programms
 
C Prog - Strings
C Prog - StringsC Prog - Strings
C Prog - Strings
 
C PROGRAMS
C PROGRAMSC PROGRAMS
C PROGRAMS
 

Andere mochten auch

Aj old presentation - pssc research-pt_
Aj   old presentation - pssc research-pt_Aj   old presentation - pssc research-pt_
Aj old presentation - pssc research-pt_ajackson12
 
The Paleo Diet
The Paleo Diet The Paleo Diet
The Paleo Diet Hopey78
 
How To Listen To Your Customers
How To Listen To Your CustomersHow To Listen To Your Customers
How To Listen To Your CustomersCharlesThornhill
 
Computer
ComputerComputer
ComputerIIFP
 
эта книга посвящается всем женщинам
эта книга посвящается всем женщинамэта книга посвящается всем женщинам
эта книга посвящается всем женщинамЕлена Семенец
 
S.B.C Outfitters
S.B.C OutfittersS.B.C Outfitters
S.B.C Outfitterseperiod
 
How to make a stuffed frog
How to make a stuffed frogHow to make a stuffed frog
How to make a stuffed froglyra_sch
 
การจัดการต้รทุน อุตสาหกรรมผลิต
การจัดการต้รทุน อุตสาหกรรมผลิตการจัดการต้รทุน อุตสาหกรรมผลิต
การจัดการต้รทุน อุตสาหกรรมผลิตMobile_Clinic
 
Biofuels: A Guide for Coordinating a Fryer to Fuel Collection Program in Sant...
Biofuels: A Guide for Coordinating a Fryer to Fuel Collection Program in Sant...Biofuels: A Guide for Coordinating a Fryer to Fuel Collection Program in Sant...
Biofuels: A Guide for Coordinating a Fryer to Fuel Collection Program in Sant...ZX7
 
Impact library adelaide q3 2012
Impact library adelaide q3 2012Impact library adelaide q3 2012
Impact library adelaide q3 2012Guy Turner
 
11 project-online20library20management20system-110809063139-phpapp01(2)
11 project-online20library20management20system-110809063139-phpapp01(2)11 project-online20library20management20system-110809063139-phpapp01(2)
11 project-online20library20management20system-110809063139-phpapp01(2)Roopal Shrivastava
 
第8章 运行时的存储管理
第8章 运行时的存储管理第8章 运行时的存储管理
第8章 运行时的存储管理tjpucompiler
 
Photoshoot temporada 3
Photoshoot temporada 3Photoshoot temporada 3
Photoshoot temporada 3pll-latam
 
Far More Could Be Done To Stop The Deadly Bacteria C
Far More Could Be Done To Stop The Deadly Bacteria CFar More Could Be Done To Stop The Deadly Bacteria C
Far More Could Be Done To Stop The Deadly Bacteria Cesalozzo
 
Implementation Of Integrated Project Management And Resource Management System
Implementation Of Integrated Project Management And Resource Management SystemImplementation Of Integrated Project Management And Resource Management System
Implementation Of Integrated Project Management And Resource Management Systemkdelcol
 

Andere mochten auch (20)

Aj old presentation - pssc research-pt_
Aj   old presentation - pssc research-pt_Aj   old presentation - pssc research-pt_
Aj old presentation - pssc research-pt_
 
The Paleo Diet
The Paleo Diet The Paleo Diet
The Paleo Diet
 
SMBtweet
SMBtweetSMBtweet
SMBtweet
 
How To Listen To Your Customers
How To Listen To Your CustomersHow To Listen To Your Customers
How To Listen To Your Customers
 
Pragmatics
PragmaticsPragmatics
Pragmatics
 
Kevin g nice
Kevin g niceKevin g nice
Kevin g nice
 
Computer
ComputerComputer
Computer
 
эта книга посвящается всем женщинам
эта книга посвящается всем женщинамэта книга посвящается всем женщинам
эта книга посвящается всем женщинам
 
S.B.C Outfitters
S.B.C OutfittersS.B.C Outfitters
S.B.C Outfitters
 
How to make a stuffed frog
How to make a stuffed frogHow to make a stuffed frog
How to make a stuffed frog
 
Pup
PupPup
Pup
 
модель
модельмодель
модель
 
การจัดการต้รทุน อุตสาหกรรมผลิต
การจัดการต้รทุน อุตสาหกรรมผลิตการจัดการต้รทุน อุตสาหกรรมผลิต
การจัดการต้รทุน อุตสาหกรรมผลิต
 
Biofuels: A Guide for Coordinating a Fryer to Fuel Collection Program in Sant...
Biofuels: A Guide for Coordinating a Fryer to Fuel Collection Program in Sant...Biofuels: A Guide for Coordinating a Fryer to Fuel Collection Program in Sant...
Biofuels: A Guide for Coordinating a Fryer to Fuel Collection Program in Sant...
 
Impact library adelaide q3 2012
Impact library adelaide q3 2012Impact library adelaide q3 2012
Impact library adelaide q3 2012
 
11 project-online20library20management20system-110809063139-phpapp01(2)
11 project-online20library20management20system-110809063139-phpapp01(2)11 project-online20library20management20system-110809063139-phpapp01(2)
11 project-online20library20management20system-110809063139-phpapp01(2)
 
第8章 运行时的存储管理
第8章 运行时的存储管理第8章 运行时的存储管理
第8章 运行时的存储管理
 
Photoshoot temporada 3
Photoshoot temporada 3Photoshoot temporada 3
Photoshoot temporada 3
 
Far More Could Be Done To Stop The Deadly Bacteria C
Far More Could Be Done To Stop The Deadly Bacteria CFar More Could Be Done To Stop The Deadly Bacteria C
Far More Could Be Done To Stop The Deadly Bacteria C
 
Implementation Of Integrated Project Management And Resource Management System
Implementation Of Integrated Project Management And Resource Management SystemImplementation Of Integrated Project Management And Resource Management System
Implementation Of Integrated Project Management And Resource Management System
 

Ähnlich wie Binary tree

Ähnlich wie Binary tree (19)

C program to implement linked list using array abstract data type
C program to implement linked list using array abstract data typeC program to implement linked list using array abstract data type
C program to implement linked list using array abstract data type
 
Solutionsfor co2 C Programs for data structures
Solutionsfor co2 C Programs for data structuresSolutionsfor co2 C Programs for data structures
Solutionsfor co2 C Programs for data structures
 
week-14x
week-14xweek-14x
week-14x
 
Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02
 
My C proggram is having trouble in the switch in main. Also the a co.pdf
My C proggram is having trouble in the switch in main. Also the a co.pdfMy C proggram is having trouble in the switch in main. Also the a co.pdf
My C proggram is having trouble in the switch in main. Also the a co.pdf
 
VTU Data Structures Lab Manual
VTU Data Structures Lab ManualVTU Data Structures Lab Manual
VTU Data Structures Lab Manual
 
Ds
DsDs
Ds
 
Data Structure in C Programming Language
Data Structure in C Programming LanguageData Structure in C Programming Language
Data Structure in C Programming Language
 
C program
C programC program
C program
 
Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020
 
Arrays
ArraysArrays
Arrays
 
week-18x
week-18xweek-18x
week-18x
 
week-17x
week-17xweek-17x
week-17x
 
One dimensional operation of Array in C- language
One dimensional operation of Array in C- language One dimensional operation of Array in C- language
One dimensional operation of Array in C- language
 
Ada file
Ada fileAda file
Ada file
 
Polynomial addition
Polynomial additionPolynomial addition
Polynomial addition
 
Chapter 8 c solution
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solution
 
SaraPIC
SaraPICSaraPIC
SaraPIC
 
Singly linked list.pptx
Singly linked list.pptxSingly linked list.pptx
Singly linked list.pptx
 

Kürzlich hochgeladen

An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismDabee Kamal
 
How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17Celine George
 
Application of Matrices in real life. Presentation on application of matrices
Application of Matrices in real life. Presentation on application of matricesApplication of Matrices in real life. Presentation on application of matrices
Application of Matrices in real life. Presentation on application of matricesRased Khan
 
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17Celine George
 
2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptxmansk2
 
IATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdffIATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdff17thcssbs2
 
Open Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPointOpen Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPointELaRue0
 
size separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceuticssize separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceuticspragatimahajan3
 
How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17Celine George
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxheathfieldcps1
 
Behavioral-sciences-dr-mowadat rana (1).pdf
Behavioral-sciences-dr-mowadat rana (1).pdfBehavioral-sciences-dr-mowadat rana (1).pdf
Behavioral-sciences-dr-mowadat rana (1).pdfaedhbteg
 
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatmentsaipooja36
 
Discover the Dark Web .pdf InfosecTrain
Discover the Dark Web .pdf  InfosecTrainDiscover the Dark Web .pdf  InfosecTrain
Discover the Dark Web .pdf InfosecTraininfosec train
 
Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024CapitolTechU
 
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...Nguyen Thanh Tu Collection
 
Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Celine George
 
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdf
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdfPost Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdf
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdfPragya - UEM Kolkata Quiz Club
 
Navigating the Misinformation Minefield: The Role of Higher Education in the ...
Navigating the Misinformation Minefield: The Role of Higher Education in the ...Navigating the Misinformation Minefield: The Role of Higher Education in the ...
Navigating the Misinformation Minefield: The Role of Higher Education in the ...Mark Carrigan
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...Nguyen Thanh Tu Collection
 

Kürzlich hochgeladen (20)

An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17
 
Application of Matrices in real life. Presentation on application of matrices
Application of Matrices in real life. Presentation on application of matricesApplication of Matrices in real life. Presentation on application of matrices
Application of Matrices in real life. Presentation on application of matrices
 
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
 
2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx
 
IATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdffIATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdff
 
Open Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPointOpen Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPoint
 
size separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceuticssize separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceutics
 
How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
 
Behavioral-sciences-dr-mowadat rana (1).pdf
Behavioral-sciences-dr-mowadat rana (1).pdfBehavioral-sciences-dr-mowadat rana (1).pdf
Behavioral-sciences-dr-mowadat rana (1).pdf
 
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 
Discover the Dark Web .pdf InfosecTrain
Discover the Dark Web .pdf  InfosecTrainDiscover the Dark Web .pdf  InfosecTrain
Discover the Dark Web .pdf InfosecTrain
 
Word Stress rules esl .pptx
Word Stress rules esl               .pptxWord Stress rules esl               .pptx
Word Stress rules esl .pptx
 
Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024
 
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
 
Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17
 
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdf
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdfPost Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdf
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdf
 
Navigating the Misinformation Minefield: The Role of Higher Education in the ...
Navigating the Misinformation Minefield: The Role of Higher Education in the ...Navigating the Misinformation Minefield: The Role of Higher Education in the ...
Navigating the Misinformation Minefield: The Role of Higher Education in the ...
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 

Binary tree

  • 1.
  • 2. #include<stdio.h> printf("n***MENU***"); #include<conio.h> printf("n1.CREATEn2.PRE-ORDER"); #include<alloc.h> printf("n3.IN-ORDERn4.POST- void create(struct node *); ORDERn5.EXIT"); void in_order(); printf("nPLease Enter the Choice..."); void pre_order(); scanf("%d",&ch); void post_order(); switch(ch) struct node { { case 1:root=NULL; int data; create(root);break; struct node *left,*right; case 2:pre_order();break; }*root=NULL,*New,*temp,*p,*stack[20]; case 3:in_order();break; int top=-1,flag[20],item; case 4:post_order();break; char c; case 5:exit(0); default: printf("nInvalid choice..."); void main() } { }while(ch!=5); int ch,e; getch(); clrscr(); } do {
  • 3. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL)//Is It first node? if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ",t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("nDo you want add Another(y/n)..."); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); } } } } else { New=(struct node *) malloc (sizeof (struct node));
  • 4. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL)//Is It first node? if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ",t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("nDo you want add Another(y/n)..."); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); } } } } else { New=(struct node *) malloc (sizeof (struct node));
  • 5. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL)//Is It first node? if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ",t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("nDo you want add Another(y/n)..."); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); New } } } } else { New=(struct node *) malloc (sizeof (struct node));
  • 6. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); 100 struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ",t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("nDo you want add Another(y/n)..."); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 New } } } } else { New=(struct node *) malloc (sizeof (struct node));
  • 7. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ",t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("nDo you want add Another(y/n)..."); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 New } } } } else { New=(struct node *) malloc (sizeof (struct node));
  • 8. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ",t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("nDo you want add Another(y/n)..."); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 New } } root } } else { New=(struct node *) malloc (sizeof (struct node));
  • 9. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ",t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); y { if(ch=='y') s=t; create(t->right); create(root); 100 New } } root } } else { New=(struct node *) malloc (sizeof (struct node));
  • 10. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ",t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 New } } root } } else { New=(struct node *) malloc (sizeof (struct node));
  • 11. void create(struct node *t) t = 100 New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ",t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } } } else { New=(struct node *) malloc (sizeof (struct node));
  • 12. void create(struct node *t) t = 100 New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ",t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } } } else { New=(struct node *) malloc (sizeof (struct node));
  • 13. void create(struct node *t) t = 100 New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ",t->data); if(c=='l' || c=='L‘) scanf("%c",&c); l s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } } } else { New=(struct node *) malloc (sizeof (struct node));
  • 14. void create(struct node *t) t = 100 New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } } } else { New=(struct node *) malloc (sizeof (struct node));
  • 15. void create(struct node *t) t = 100 New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } s } } else { New=(struct node *) malloc (sizeof (struct node));
  • 16. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } s } } else { New=(struct node *) malloc (sizeof (struct node));
  • 17. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } s } } else { New=(struct node *) malloc (sizeof (struct node));
  • 18. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); 50 struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } s } } else 50 New { New=(struct node *) malloc (sizeof (struct node));
  • 19. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } s } } else 50 New { New=(struct node *) malloc (sizeof (struct node));
  • 20. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } s } } else 50 New { New=(struct node *) malloc (sizeof (struct node));
  • 21. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } s } } else 50 New { New=(struct node *) malloc (sizeof (struct node));
  • 22. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); y { if(ch=='y') s=t; create(t->right); create(root); 100 root } } } } else 50 { New=(struct node *) malloc (sizeof (struct node));
  • 23. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } } } else 50 { New=(struct node *) malloc (sizeof (struct node));
  • 24. void create(struct node *t) t = 100 New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } } } else 50 { New=(struct node *) malloc (sizeof (struct node));
  • 25. void create(struct node *t) t = 100 New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } } } else 50 { New=(struct node *) malloc (sizeof (struct node));
  • 26. void create(struct node *t) t = 100 New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); r s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } } } else 50 { New=(struct node *) malloc (sizeof (struct node));
  • 27. void create(struct node *t) t = 100 New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } } } else 50 { New=(struct node *) malloc (sizeof (struct node));
  • 28. void create(struct node *t) t = 100 New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } s } } else 50 { New=(struct node *) malloc (sizeof (struct node));
  • 29. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } s } } else 50 { New=(struct node *) malloc (sizeof (struct node));
  • 30. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } s } } else 50 { New=(struct node *) malloc (sizeof (struct node));
  • 31. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); 60 struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } s } } else 50 60 New { New=(struct node *) malloc (sizeof (struct node));
  • 32. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } s } } else 50 60 New { New=(struct node *) malloc (sizeof (struct node));
  • 33. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } s } } else 50 60 New { New=(struct node *) malloc (sizeof (struct node));
  • 34. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } s } } else 50 60 New { New=(struct node *) malloc (sizeof (struct node));
  • 35. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); n { if(ch=='y') s=t; create(t->right); create(root); 100 root } } s } } else 50 60 New { New=(struct node *) malloc (sizeof (struct node));
  • 36. void create(struct node *t) t = NULL New->left=New->right=NULL; { printf("nEnter the Element..."); char ch; scanf("%d",&New->data); struct node *s; if(root==NULL) if(t!=NULL) root=New; { else printf("nWhether you want to insert at { Left or Rigth( L/R) of %d ", t->data); if(c=='l' || c=='L‘) scanf("%c",&c); s->left=New; if(c=='l'|| c=='L‘) else { s->right=New; s=t; create(t->left); } } printf("Do you want add Another (y/n)"); else scanf("%c",&ch); { if(ch=='y') s=t; create(t->right); create(root); 100 root } } } } else 50 60 { New=(struct node *) malloc (sizeof (struct node));
  • 37. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 do { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } 1 if(top!=0) 0 { top = -1 finish = 0 p=stack[top]; top--;
  • 38. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p p=root; printf("nInorder Traversal is...n"); 50 60 do { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } 1 if(top!=0) top 0 NULL { finish = 0 p=stack[top]; top--;
  • 39. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p p=root; printf("nInorder Traversal is...n"); 50 60 do { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } 1 if(top!=0) top0 NULL { finish = 0 p=stack[top]; top--;
  • 40. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); p 50 60 do { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } top1 100 if(top!=0) 0 NULL { finish = 0 p=stack[top]; top--;
  • 41. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); p 50 60 do { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } top1 100 if(top!=0) 0 NULL { p=stack[top]; finish = 0 top--;
  • 42. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 do p NULL { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; top2 50 } 1 100 if(top!=0) 0 NULL { finish = 0 p=stack[top]; top--;
  • 43. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 do p NULL { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; top2 50 } 1 100 if(top!=0) 0 NULL { finish = 0 p=stack[top]; top--;
  • 44. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 do p NULL { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; top2 50 } 1 100 if(top!=0) 0 NULL { finish = 0 p=stack[top]; top--;
  • 45. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); p 50 60 do { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } top1 100 if(top!=0) 0 NULL { finish = 0 p=stack[top]; top--;
  • 46. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 do p NULL { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } top1 100 if(top!=0) 0 NULL { finish = 0 p=stack[top]; 50 100 top--;
  • 47. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 do p NULL { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } top1 100 if(top!=0) 0 NULL { finish = 0 p=stack[top]; 50 100 top--;
  • 48. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 do p NULL { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } top1 100 if(top!=0) 0 NULL { finish = 0 p=stack[top]; 50 100 top--;
  • 49. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 do p NULL { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } top1 100 if(top!=0) 0 NULL { finish = 0 p=stack[top]; 50 100 top--;
  • 50. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p p=root; printf("nInorder Traversal is...n"); 50 60 do { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } 1 if(top!=0) top0 NULL { finish = 0 p=stack[top]; 50 100 top--;
  • 51. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 p do { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } 1 if(top!=0) top0 NULL { finish = 0 p=stack[top]; 50 100 top--;
  • 52. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 p do { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } 1 if(top!=0) top0 NULL { finish = 0 p=stack[top]; 50 100 top--;
  • 53. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 p do { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } 1 if(top!=0) top0 NULL { finish = 0 p=stack[top]; 50 100 top--;
  • 54. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 do p NULL { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } top1 60 if(top!=0) 0 NULL { finish = 0 p=stack[top]; 50 100 top--;
  • 55. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 do p NULL { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } top1 60 if(top!=0) 0 NULL { finish = 0 p=stack[top]; 50 100 top--;
  • 56. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 do p NULL { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } top1 60 if(top!=0) 0 NULL { finish = 0 p=stack[top]; 50 100 top--;
  • 57. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 p do { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } 1 if(top!=0) top0 NULL { finish = 0 p=stack[top]; 50 100 top--;
  • 58. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 do p NULL { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } 1 if(top!=0) top0 NULL { finish = 0 p=stack[top]; 50 100 60 top--;
  • 59. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 do p NULL { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } 1 if(top!=0) top0 NULL { finish = 0 p=stack[top]; 50 100 60 top--;
  • 60. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 do p NULL { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } 1 if(top!=0) top0 NULL { finish = 0 p=stack[top]; 50 100 60 top--;
  • 61. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 do p NULL { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } 1 if(top!=0) top0 NULL { finish = 0 p=stack[top]; 50 100 60 top--;
  • 62. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 do p NULL { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } 1 if(top!=0) top0 NULL { finish = 1 p=stack[top]; 50 100 60 top--;
  • 63. void in_order() printf("%d ",p->data); { p=p->right; int finish=0; } if(root==NULL) else { finish=1; printf("nTree is Empty...");return; }while(finish==0); } } 100 root stack[++top]=NULL; p=root; printf("nInorder Traversal is...n"); 50 60 do p NULL { while(p!=NULL) { 4 stack[++top]=p; 3 p=p->left; 2 } 1 if(top!=0) top0 NULL { finish = 1 p=stack[top]; 50 100 60 top--;
  • 64. void pre_order() { if(root==NULL) { printf("nTree is Empty..."); return; } 100 root stack[++top]=NULL; p=root; printf("nPreorder Traversal is...n"); 50 60 while(p!=NULL) { printf("%d ",p->data); if(p->right!=NULL) 4 stack[++top]=p->right; 3 if(p->left!=NULL) 2 p=p->left; 1 else 0 p=stack[top--]; top = -1 finish = 0 } }
  • 65. void pre_order() { if(root==NULL) { printf("nTree is Empty..."); return; } 100 root stack[++top]=NULL; p p=root; printf("nPreorder Traversal is...n"); 50 60 while(p!=NULL) { printf("%d ",p->data); if(p->right!=NULL) 4 stack[++top]=p->right; 3 if(p->left!=NULL) 2 p=p->left; 1 else top0 NULL p=stack[top--]; } }
  • 66. void pre_order() { if(root==NULL) { printf("nTree is Empty..."); return; } 100 root stack[++top]=NULL; p p=root; printf("nPreorder Traversal is...n"); 50 60 while(p!=NULL) { printf("%d ",p->data); if(p->right!=NULL) 4 stack[++top]=p->right; 3 if(p->left!=NULL) 2 p=p->left; 1 else top0 NULL p=stack[top--]; } }
  • 67. void pre_order() { if(root==NULL) { printf("nTree is Empty..."); return; } 100 root stack[++top]=NULL; p p=root; printf("nPreorder Traversal is...n"); 50 60 while(p!=NULL) { printf("%d ",p->data); if(p->right!=NULL) 4 stack[++top]=p->right; 3 if(p->left!=NULL) 2 p=p->left; 1 else top0 NULL p=stack[top--]; } 100 }
  • 68. void pre_order() { if(root==NULL) { printf("nTree is Empty..."); return; } 100 root stack[++top]=NULL; p p=root; printf("nPreorder Traversal is...n"); 50 60 while(p!=NULL) { printf("%d ",p->data); if(p->right!=NULL) 4 stack[++top]=p->right; 3 if(p->left!=NULL) 2 p=p->left; 1 else top0 NULL p=stack[top--]; } 100 }
  • 69. void pre_order() { if(root==NULL) { printf("nTree is Empty..."); return; } 100 root stack[++top]=NULL; p p=root; printf("nPreorder Traversal is...n"); 50 60 while(p!=NULL) { printf("%d ",p->data); if(p->right!=NULL) 4 stack[++top]=p->right; 3 if(p->left!=NULL) 2 p=p->left; top1 60 else 0 NULL p=stack[top--]; } 100 }
  • 70. void pre_order() { if(root==NULL) { printf("nTree is Empty..."); return; } 100 root stack[++top]=NULL; p p=root; printf("nPreorder Traversal is...n"); 50 60 while(p!=NULL) { printf("%d ",p->data); if(p->right!=NULL) 4 stack[++top]=p->right; 3 if(p->left!=NULL) 2 p=p->left; top1 60 else 0 NULL p=stack[top--]; } 100 }
  • 71. void pre_order() { if(root==NULL) { printf("nTree is Empty..."); return; } 100 root stack[++top]=NULL; p=root; printf("nPreorder Traversal is...n"); p 50 60 while(p!=NULL) { printf("%d ",p->data); if(p->right!=NULL) 4 stack[++top]=p->right; 3 if(p->left!=NULL) 2 p=p->left; top1 60 else 0 NULL p=stack[top--]; } 100 }
  • 72. void pre_order() { if(root==NULL) { printf("nTree is Empty..."); return; } 100 root stack[++top]=NULL; p=root; printf("nPreorder Traversal is...n"); p 50 60 while(p!=NULL) { printf("%d ",p->data); if(p->right!=NULL) 4 stack[++top]=p->right; 3 if(p->left!=NULL) 2 p=p->left; top1 60 else 0 NULL p=stack[top--]; } 100 }
  • 73. void pre_order() { if(root==NULL) { printf("nTree is Empty..."); return; } 100 root stack[++top]=NULL; p=root; printf("nPreorder Traversal is...n"); p 50 60 while(p!=NULL) { printf("%d ",p->data); if(p->right!=NULL) 4 stack[++top]=p->right; 3 if(p->left!=NULL) 2 p=p->left; top1 60 else 0 NULL p=stack[top--]; } 100 50 }
  • 74. void pre_order() { if(root==NULL) { printf("nTree is Empty..."); return; } 100 root stack[++top]=NULL; p=root; printf("nPreorder Traversal is...n"); p 50 60 while(p!=NULL) { printf("%d ",p->data); if(p->right!=NULL) 4 stack[++top]=p->right; 3 if(p->left!=NULL) 2 p=p->left; top1 60 else 0 NULL p=stack[top--]; } 100 50 }
  • 75. void pre_order() { if(root==NULL) { printf("nTree is Empty..."); return; } 100 root stack[++top]=NULL; p=root; printf("nPreorder Traversal is...n"); 50 60 p while(p!=NULL) { printf("%d ",p->data); if(p->right!=NULL) 4 stack[++top]=p->right; 3 if(p->left!=NULL) 2 p=p->left; 1 else top0 NULL p=stack[top--]; } 100 50 }
  • 76. void pre_order() { if(root==NULL) { printf("nTree is Empty..."); return; } 100 root stack[++top]=NULL; p=root; printf("nPreorder Traversal is...n"); 50 60 p while(p!=NULL) { printf("%d ",p->data); if(p->right!=NULL) 4 stack[++top]=p->right; 3 if(p->left!=NULL) 2 p=p->left; 1 else top0 NULL p=stack[top--]; } 100 50 }
  • 77. void pre_order() { if(root==NULL) { printf("nTree is Empty..."); return; } 100 root stack[++top]=NULL; p=root; printf("nPreorder Traversal is...n"); 50 60 p while(p!=NULL) { printf("%d ",p->data); if(p->right!=NULL) 4 stack[++top]=p->right; 3 if(p->left!=NULL) 2 p=p->left; 1 else top0 NULL p=stack[top--]; } 100 50 60 }
  • 78. void pre_order() { if(root==NULL) { printf("nTree is Empty..."); return; } 100 root stack[++top]=NULL; p=root; printf("nPreorder Traversal is...n"); 50 60 p while(p!=NULL) { printf("%d ",p->data); if(p->right!=NULL) 4 stack[++top]=p->right; 3 if(p->left!=NULL) 2 p=p->left; 1 else top0 NULL p=stack[top--]; } 100 50 60 }
  • 79. void pre_order() { if(root==NULL) { printf("nTree is Empty..."); return; } 100 root stack[++top]=NULL; p=root; printf("nPreorder Traversal is...n"); 50 60 while(p!=NULL) p NULL { printf("%d ",p->data); if(p->right!=NULL) 4 stack[++top]=p->right; 3 if(p->left!=NULL) 2 p=p->left; 1 else 0 p=stack[top--]; top = -1 } 100 50 60 }
  • 80. void pre_order() { if(root==NULL) { printf("nTree is Empty..."); return; } 100 root stack[++top]=NULL; p=root; printf("nPreorder Traversal is...n"); 50 60 while(p!=NULL) p NULL { printf("%d ",p->data); if(p->right!=NULL) 4 stack[++top]=p->right; 3 if(p->left!=NULL) 2 p=p->left; 1 else 0 p=stack[top--]; top = -1 } 100 50 60 }
  • 81. void post_order() { int f; if(root==NULL) { printf("nTree is Empty..."); return; 100 root } stack[++top]=NULL; 50 60 p=root; printf("nPostorder Traversal is...n"); 4 4 3 3 2 2 1 1 0 0 top = -1
  • 82. void post_order() { int f; if(root==NULL) { printf("nTree is Empty..."); return; 100 root } p stack[++top]=NULL; 50 60 p=root; printf("nPostorder Traversal is...n"); 4 4 3 3 2 2 1 1 0 top 0 NULL