Big O - Is Log(A) + Log(B) == Log(AB) complexity?

Viewed 93
1 Answers

Yes, since you can manipulate the terms in Big-O notation in familiar algebraic ways, O(Log A + Log B) = O(Log AB).

When talking about two sequential searches, though, it might be more intuitive to leave it at O(Log A + Log B). You might want to simplify that to O(Log AB) if you're comparing to some other algorithm, or trying to find dominant terms.

Related