Counting the number of leaf nodes in a binary tree
Given a binary tree, write a program to count the number of leaf nodes. A leaf node is a node which does not have left and right children.For example consider the following binary tree. It has 3 leaf nodes namely 1, 4 and 7. The solution is simple. The number of leaf nodes of a…