Discussion:
Q: Trace the following tree-traversal function, f(), and describe its action:
template
int f(tnode *t)
{ int n = 0, leftValue, rightValue;
if (t != NULL)
{
if (t ->left != NULL || t->right != NULL)
n++;
leftValue = f(t->left);
rightValue = f(t->right);
return n + leftValue + rightValue;
}
else
return 0;
}