跳到主要内容位置

Types-of-Time-functions

O(1)O(1)constant
O(logn)O(logn)Logrithemtic
O(n)O(n)Linear
O(n2)O(n^2)Quadratic
O(n3)O(n^3)Cubic
O(2n)O(2^n)Exponential
O(3n)O(3^n)...

f(n)=3n+2  f(n)=5  f(n)=50000  complexity all O(1)f(n) = 3n + 2 \space\space f(n) = 5 \space\space f(n) = 50000 \space\space complexity\space all \space O(1)

f(n)=2n+3  f(n)=5000n+700  f(n)=n500  omplexity all O(n)f(n) = 2n + 3 \space\space f(n) = 5000n + 700 \space\space f(n) = \frac {n}{500} \space\space omplexity\space all \space O(n)

Asymptotic rules

1<O(logn)<(n)<n<nlogn<n2<n3<....<2n<3n<....<nn1 < O(logn) < \sqrt(n) < n < n\log n < n^2 < n ^ 3 < .... < 2 ^ n < 3 ^n < ....< n ^n