Reputation: 440
I've been asked a question that seems strange to me. Given the following two equalities, which is true, and which is false (or are they both either true or false)?
O(n^2) = O(n^3)
O(n^3) = O(n^2)
To me, this question seems absurd, since O(f(n)) just means that for some time function T(n), lim as n -> infty of T(n) <= c * f(n).
Upvotes: 0
Views: 289
Reputation: 144
O(f(n)) can be thought of as the class of all functions whose growth is bounded above by f(n). Taking into account this, the two options are false.
Upvotes: 1