answersLogoWhite

0

struct node{

int data;

struct node *left, *right;

};

typedef struct node node;

non recursive method :

main()

{

node * root = NULL , *new = NULL *temp1 =NULL , * temp2 = NULL;

int num =1;

printf(" Enter the elements of the tree( enter 0 to exit)\n");

while(1)

{

scanf("%d", &num);

if(num==0)

break;

new = malloc(sizeof(node));

new->left = new->right = NULL;

new->data = num;

if( root NULL)

root->left = new;

else

insert( new,root->left);

}

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Write a program of binary heap in c or c language?

to implement operations on binary heap in c


Write a program to implement prim's algorithm?

dfgbrgffee


How do you write a c program to convert binary to decimal by using while statement?

write a c++ program to convert binary number to decimal number by using while statement


Write A program to implement insertion using AVL trees?

yes


Write a program to implement domain and referential integrity?

give me the program which can related on domain and referential integrity.


Write a C program that takes a binary file as input and finds error check using different mechanisms?

write a c program that takes a binary file as input and finds error check using different mechanisms.


Write a program in c plus plus to implement macro processor?

Don't write, it is already written, google for 'cpp'.


Write a program in c language to implement framing methods like character stuffing?

A program in c language to implement framing methods like character stuffing can be grave sizeCRC-32 and the variable c50.


Write a program to implement a line using slope intercept formula?

lund lelo mooh mein


How can you write a program to convert binary code to gray code using 8085 microprocessor?

It can be implemented very easily .... Suppose the Binary word is X7X6X5.... X0 then the corresponding Gray code is G7G6G5....G0 where G7=X7 G6=X7 XOR X6 G5=X6 XOR X5 ..... G0=X1 XOR X0 Now implement the above algorithm


Write a program that takes a binary file as input and finds error check using different mechanism?

networking


Write a C program to implement excelp system call?

You are not able to do that, but you can write a program, that uses the system-call./* exectest.c */#include int main (void){execlp ("/bin/ls", "ls", "-ld", ".", NULL);return 0;}