Given an algorithm:
void preorder(tree *t)
{
if(t)
{
1. if(t->data==NULL)
return ;
else printf(t->data);
2. preorder(t->left);
3. preorder(t->right);
}
}
Find the number of function calls made for traversing for preorder following above algorithm,for th below given tree;
A
/ \
B C
/ \
D E
\ /
F G