2 ms·
A function f(n) is O(g(n)) if the graph of f will be underneath the graph of g(n) for a big enough n. (If we want to be more correct, then I would have to add
by kaba0 6y ago
A function f(n) is O(g(n)) if the graph of f will be underneath the graph of g(n) for a big enough n.
(If we want to be more correct, then I would have to add that if there exists a positive number c, and cg should be above the graph of f)
So f(n):=3n+28 will be O(n^2), because choosing c as 3, for every n greater than or equal 4, 3n^2 will be greater than f(n).
It would help if I could draw some graphs, but hopefully it helps.