int q(int n)
{
if (n <= 0) return 0;
return 1-q(q(n-1));
}
I'm not sure how to approach this. I tried representing the time complexity as a function $T(n)$ and then use repeated substitutions: So I got $T(n)=C+T(T(n-1))$ where $C$ is a constant representing a constant amount of lines we have in the function. Using repeated substitution we get: $T(n)=C+T(C+T(...T(C+T(0))))$, but $T(0)=0$ so $T(n)=C+T(C+T(...T(C)))$ and now we got a function that is only dependent on $C$ which is a constant, but I don't know how to continue from here.