f(x) = O(g(x)) , c>0 n>0 , :
c*g(x) > f(x) x, n.
O, , .
- O . O(g) = { f : c*g(x) >= f(x) for all x > n} c n, . , , f O(g), , , .
, , , . O(n^2) O(n), n = O(n^2) , n^2 = O(n) ( , != = sign O- , , ).
Another thing is, if you want to deceive your task, just answer O(n!)everything and you will be technically correct (the best right option). Now, when people ask "what order is this function", they ask for a tight binding, that is, the smallest growing function that will still act as a border. You might want to look up definitions for other related notations .
source
share