struct Tree
{
struct Tree *left;
struct Tree *right;
};
static int countHelper(struct Tree *t)
{
int count = 0;
while (t)
{ count += 1 + countHelper(t->right);
t = t->left;
}
return count;
}
void doCount(struct Tree *t)
{
int count = countHelper(t);
printf("number of nodes in tree = %d\n", count);
}