public static int fxn1(int N){
if(N == 0)
return 0;
return fx1(N/2) + fxn2(N) + fxn1(N/2);
}
The answer is O(nlogn)
I understand that fxn1 is O(logn)
because of divide and conquer also fxn2
is O(n)
so combine they all wouldn't it be O(logn)+O(n)+O(nlogn) = O(nlogn^2)
?
Please exaplain. Thanks