C program to calculate size of binary tree

Problem statement :

Given a Binary tree write a c program to calculate size of binary tree

Explanation :

Size of Binary tree is defined as total no of nodes in binary tree.

Solution :

Applying recursive approach

if root is NULL then size is zero

else size of left subtree ,right subtree and +1 for the root node.

 

Click here to get binary search tree implementation code.