, , .
- O(N), O(N+1), O(2n+3), O(6N + -e) O(.67777N - e^67). O(N), , , O(N+1), - O(n) as it was O (n + 1 ) `.
. big-O, . g (n) = O (f (n)), f (n) = O (k (n)) --implies- > g (n) = O (k (n))
( , google O). , .
n = O(n+1), factorial1 = O(n) --implies--> factorial1 = O(n+1)
, O (N) O (N + 1). . , , . . .
Θ, , , . :
Θ(1)
Θ(log(n))
Θ(n)
Θ(n^2)
Θ(n^3)
Θ(2^n)
Θ(n!)
Θ. 2 , , , . Θ .
, -0, , Θ, , O.
, , , , " O(N+1)". O(N) - " , , ". :
a function is more O(N+1) and less `O(N)`
would be equivalent to saying
a function is more "a member of the set of all functions that have linear
growth rate or less growth rate" and less "a member of the set of all
functions that have linear or less growth rate"
This is pretty absurd, not the right thing.
source
share