I have following method
int function(int n) {
if(n<20) {
return 19;
}
return 20 + function(n/2) + function(n/2);
}
I believe that the runtime complexity with function(n/2)
is O(log(n))
. But I am confused about this. Can anyone explain the runtime complexity for this method. I would really appreciate your effort.
Thanks