Saturday, 12 April 2014

Size of a Binary Tree

Recursion algorithm to find out the size of a binary tree:

int treeSize(struct Tree *node)
{
if(node == NULL) return 0;
else
return treeSize(node->left) + 1 + treeSize(node->right);


For other tree operations and complete code refer: click here

No comments:

Post a Comment

AWS Data Pipeline Services

https://www.youtube.com/watch?v=tykcCf-Zz1M