Big-Oh
1
Big-Oh 1 asymptotic growth rate or order compare two functions, but - - PowerPoint PPT Presentation
Big-Oh 1 asymptotic growth rate or order compare two functions, but ignore constant factors, small inputs example: ; grows faster eventually much bigger than goal: predict behavior here ignore behavior here 2 asymptotic growth rate
1
2
2
2
2
2
3
4
4
5
5
5
5
5
5
5
6
6
and and 7
and 10n2 + n ∈ O(n2) and 10n2 + n ∈ Ω(n2) 7
8
8
8
9
9
9
10
10
10
11
11
12
12
12
13
14
bad = (c + 100)2(n0 + 100)2 > c(c + 100)(n0 + 100) = cnbad
bad ≤ c · g(nbad) = cnbad)
14
bad = (c + 100)2(n0 + 100)2 > c(c + 100)(n0 + 100) = cnbad
bad ≤ c · g(nbad) = cnbad)
14
15
16
17
18
19
20
20
0 = cn0(cn0)2 > cn2
21
22
23
24
24
24
24
24
24
24
24
24
24
25
26
26
27
28
29
30
31
32
33
34
35
36
37
38
N
39
N
39
N
39
N
39
40
41
42
43
44
45
46
*known algorithms — maybe can do better?
47
48