C++ Programs
Basic programs using C++ language
Monday, January 16, 2012
Counting number of elements in a tree
int count(node * root)
{
if(!root)
return 0;
else
return(1+count(root->left)+count(root->right));
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment