Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int NodeCount(TREE * node)
- {
- int leftchild, rightchild;
- if (node->left == NULL && node->right == NULL)
- return 1;
- if (node->left != NULL)
- leftchild = NodeCount(node->left);
- else
- leftchild = 0;
- if (node->right != NULL)
- rightchild = NodeCount(node->right);
- else
- rightchild = 0;
- return leftchild + rightchild + 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement