#include<stdio.h>
#include<conio.h>
#define TRUE 1
#define FALSE 0
struct nodetype { int info; struct nodetype *left,*right; int rthread; };
typedef struct nodetype *NODE;
NODE maketree(int x)
{
 NODE p;
 p=(NODE)malloc((sizeof)NODE);
 p->info=x;
 p->left=p->right= NULL;
 p->rthread=TRUE;
 return(p);
}
NODE setleft(NODE p,int x) //to create a node and to insert it to left of//
{				//an existing node//
 NODE q;
 if(p==NULL) printf("\nVoid insertion");
 else if(p_.left!=NULL)  printf("\nInvalid insertion");
 else
 {
  q=maketree(x);
  p->left=q;
  q->left=NULL;
  q->right=p;
  q->rthread=TRUE;
 }
}
NODE setright(NODE p,int x)
{
 NODE q,r;
 if(p==NULL)  printf("\nVoid insertion");
 else if(!p->rthread) printf("\nInvalid insertion");
 else
 {
  q=maketree(x);
  r=p->right;
  p->right=q;
  p->rthread=FALSE;
  q->left=NULL;
  q->right=r;
  q->rthread=TRUE;
 }
}
void intrav(NODE x)
{
 NODE p,q;
 p=x;
 do
 {
  q=NULL;
  while(p!=NULL)  { q=p;
		    p=p->left;
		  }
  if(q!=NULL)  {
		  printf("%4d",q->info);
		  p=q->right;
		  while(q->rthread&&p!=NULL)
		  {
		   printf("%4d", p->info);
		   q=p;
		   p=p->right;
		  }
	       }
 }while(q!=NULL);

 void main()
 {




