This preview shows pages 1–5. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Definition of “Big Oh” CSE 2011
Prof. J. Elder 6 Last Updated: 1/7/10 10:14 AM Arithmetic Progression
The running time of
prefixAverages1 is
O(1 + 2 + …+ n) 7
6
5 The sum of the first n
integers is n(n + 1) / 2 4
3 There is a simple visual
proof of this fact 2
1 Thus, algorithm
prefixAverages1 runs in
O(n2) time
CSE 2011
Prof. J. Elder 0
1 7 2 3 4 5 6 Last Updated: 1/7/10 10:14 AM Relatives of BigOh
bigOmega
f(n) is (g(n)) if there is a constant c > 0 and an integer constant n0
f(n) c•g(n) for n 1 such that n0 bigTheta
f(n) is (g(n)) if there are constants c1 > 0
and c2 > 0 and an integer constant n0 1
such that c1•g(n) f(n) c2•g(n) for n n0
CSE 2011
Prof. J. Elder 8 Last Updated: 1/7/10 10:14 AM Intuition for Asymptotic Notation
BigOh
f(n) is O(g(n)) if f(n) is asymptotically less
than or equal to g(n)
bigOmega
f(n) is (g(n)) if f(n) is asymptotically
greater than or equal to g(n)
bigTheta
f(n) is (g(n)) if f(n) is asymptotically
equal to g(n)
CSE 2011
Prof. J. Elder 9 Last Updated: 1/7/10 10:14 AM Definition of Theta f(n) = (g(n)) CSE 2011
Prof. J. Elder  10  Last Updated: 1/7/10 10:14 AM ...
View
Full
Document
This note was uploaded on 02/14/2012 for the course CSE 2011Z taught by Professor Elder during the Fall '11 term at York University.
 Fall '11
 Elder
 Data Structures

Click to edit the document details