Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

number of nodes of bst cpp

int CountNodes(node* root)
{
    if (root == NULL) {
        return 0;
    }
    return 1 + CountNodes(root->left) + CountNodes(root->right);
}
 
PREVIOUS NEXT
Tagged: #number #nodes #bst #cpp
ADD COMMENT
Topic
Name
1+8 =