We are going over the master theorem in my algorithms class, and for one problem, I’m trying to compare nlogn vs 1 to figure out which case of the MT it falls under. But I’m having a hard timing figuring out which is bigger.
Edit: This is for solving a recurrence problem. The equation is T(n) = 2T(n/4) + N*LogN. Just threw this in incase it helps.
Think about it this way:
O(N*LogN)will increase withNin such a way that for anyX, no matter how large, you can find a value ofNsuch thatN*LogNis greater thanX.O(1)will stay the same, no matter whatNis.This means that
O(1)is asymptotically better, i.e. for some (perhaps very high) value ofNtheO(N*LogN)will become slower.