How can two algorithms
- one with
O(n²) - the other with
Ω(n)
have the same practical run time, when testing the algorithms with a large number?
How can two algorithms
O(n²)Ω(n)have the same practical run time, when testing the algorithms with a large number?
O(f(n)) is a set of functions that grow proportionally to f(n) or slower.
Ω(f(n)) is a set of functions that grow proportionally to f(n) or faster.
There are many functions that grow at least as fast as n, but not faster than n^2. For example: n, n*log n, n^1.5, n^2.