COMPLEJIDAD CONTARHOJAS(PRIVADO)

private int contarHojas(NodoEneario<T> r){
        
        NodoEneario q;//2
        if(r==null)//2
            return (0);//C1
        q = r.getHijo();//O(1)+1
        if(q==null){//2
            return (1);//C2
        }
        int acum = 0;//2
        while(q != null){//2+E()
            acum += contarHojas(q);//T(N)=(1)
            q = q.getHermano();//O(1)+1
        }
        return (acum);//C3
      
    }

T(n)=10+C1+C2+Σ(T(1)+2)+C3
T(n)=10+C1+C2+n(T(1)+2n+C3

T(n)=10+C1+C2+(T(1))+2n+C3 i=0
T(n)=10+C1+C2+(T(1))+2n+C3 i=1
T(n)=20+2C1+2C2+2(T(1))+4n+2C3 i=2
T(n)=40+4C1+4C2+3(T(1))+8n+3C3 i=3

T(n)=k+KC1+KC2+K(T(1))+Kn+KC3 i=K
T(n)=n+nC1+nC2+n(T(1))+n+n+nC3 i=n
T(n)=n(T(0))+3n+nC1+nC2+nC3
O(n)