public static int abc(int n) {
if (n <= 2) return n;
int sum = 0;
for (int j=1; j<n; j *= 2)
sum += j;
for (int k=n; k>1; k /= 2)
sum += k;
return abc(n – 1) + sum;
}
Hi there, may I know the time complexity (in big-O notation) of the following recursive code?
My answer is O(nlogn).
Just wish to check if I am correct? :)