Given a binary tree. Write a function which takes the root of the tree and returns the number of leaf nodes present in the binary tree.
struct node
{
int data;
struct node * lChild;
struct node * rChild;
};
int leafNodes(node *root)
{
// Put your code here...
}
struct node
{
int data;
struct node * lChild;
struct node * rChild;
};
int leafNodes(node *root)
{
// Put your code here...
}