Estimate the running time of counting nodes in a binary tree I am asked to write an efficient method that computes the number of nodes in T, and here is what I did:

public int numOfNodes(Node t)
{
    if (t==null)
        return 0;

    return numOfNodes(t.left) + numOfNodes(t.right)+1;
}


Every node needs invokes two recursive calls, so the running time is $O(2^N)$.

Is my estimation of the running time correct? It seems to be too slow.
Hint 1. You say the running time is $O(2^N)$ but what is $N$?  $2^N$ would indeed be bad if $N$ were the number of nodes.

Hint 2. How many times does your code visit each node in the tree?  How much time does it spend on each node?