Thank you for this. It doesn’t exactly help regarding my reasoning but I think your method is easier to prove that f is O(g). I didn’t know about it so thanks for introducing it to me^
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
There's a much more succinct and formal way of putting what I think your reasoning is:
if the limit of f(n) / g(n) is a finite number as n goes to infinity, then f is O(g).
So for example, if you're comparing
3𝑛³ + 2n²
to5𝑛³
, the limit of the ratio is3/5
, which is a finite number, so3𝑛³ + 2n²
isO(5𝑛³)
.On the other hand, if we compare
10n²
andn
, the limit is +infinity. So that means10n²
is NOTO(n)
.Thank you for this. It doesn’t exactly help regarding my reasoning but I think your method is easier to prove that f is O(g). I didn’t know about it so thanks for introducing it to me^