Binary Tree Node Data Structure

Explain What is a node data structure
Write a function such that the node data structure to visit all of the nodes in a binary tree?

Questions by koolck619

Showing Answers 1 - 1 of 1 Answers

ravi6771

  • Aug 12th, 2009
 

struct node{
int data
struct node *next;
}*root;
int count=0;
void count(struct node *nd)
{
if(nd!=NULL){
count(nd->left);
count++;
count(nd->right);
}
}
call count(root) which give the count in count variable.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions