I'm not particularly sure about the runtime of the following algorithm:
T(n) = 2T(n/2) + n/logn
I think this would be O(n)
by the Master Theorem but I don't know whether n/logn
is asymptotically equal to n
. Can someone explain it?
I'm not particularly sure about the runtime of the following algorithm:
T(n) = 2T(n/2) + n/logn
I think this would be O(n)
by the Master Theorem but I don't know whether n/logn
is asymptotically equal to n
. Can someone explain it?
n
andlog n
are not asymptotically equal. If you try to calculatelim n / log n
inn = inf
limit, you can use L'Hôpital's rule and end up quickly withlim n
which is infinity, thus proving thatn
is assymptotically bigger thanlog n
.However, the bigger problem is that, according to few places your problem is ill-conditioned. This case does not satisfy the preconditions for the Master Theorem. Loot at Example 7. - exactly your case.