Big-O Performance Analysis: - Computer: - Compiler: - Data
Big-O Performance Analysis: - Computer: - Compiler: - Data
1
7/15/15
O(N)
• Algorithm choice is
O(N2)
more important than
any other factor!
2
7/15/15
What is Big-O?
• Big-O characterizes algorithm performance.
3
7/15/15
Complexity
Complexity
4
7/15/15
Complexity
Complexity
• Comparison: time complexity of algorithms A and B
n 5,000n ⎡1.1n⎤
10 50,000 3
10
5
7/15/15
11
12
6
7/15/15
13
What is Big-O
f(n) = O(g(n)) iff ∃ positive constants c and n0 such that 0 ≤ f(n) ≤ cg(n) ∀ n ≥ n0.
14
7
7/15/15
Big-O Example
Prove f(x)=O(n4)
15
16
8
7/15/15
17
18
9
7/15/15
19
10
7/15/15
21
22
11
7/15/15
23
24
12
7/15/15
13