Binary tree traversing



Binary tree traversing..

Answer / qint

void Traverse(Node *t)
{
if(NULL == t)
return;

//in-order traversing
Traverse(t->left);
printf("%d",t->data);
Traverse(t->right);

//pre-order
printf("%d",t->data);
Traverse(t->left);
Traverse(t->right);

//post order
Traverse(t->left);
Traverse(t->right);
printf("%d",t->data);
}

Is This Answer Correct ?    13 Yes 0 No

Post New Answer

More C Interview Questions

WRITE A PROGRAM TO FIND A REVERSE OF TWO NO

7 Answers  


Why we write conio h in c?

0 Answers  


Who invented bcpl language?

0 Answers  


Difference between data structure and data base.

7 Answers   CTS, Value Labs, Zoho,


What is the main differences between C and Embedded C?

9 Answers  






How to print all the 26 alphabets in this order in C. AbCdEfGh..... it should print dynamically from a to z and do not print this using pgm like this print("Ab......"); Use loops or anything to print all alphabets

2 Answers   Hexaware,


Write a program to print ASCII code for a given digit.

0 Answers   EXL, HCL,


What is the difference between typedef and #define?

0 Answers  


program to find out date after adding 31 days to a date in the month of febraury also consider the leap year

0 Answers  


int *a[5] refers to

12 Answers   TCS,


what is c

4 Answers  


What is a void pointer in c?

0 Answers  


Categories