Professional Documents
Culture Documents
Analysis of Algorithms Lecturer: Mr. Paul Gaynor Lecture 6: Asymptotic Analysis
Analysis of Algorithms Lecturer: Mr. Paul Gaynor Lecture 6: Asymptotic Analysis
Comparing functions
Asymptotic Analysis compares functions based on behaviour when working with very large values Given two functions f(n) and g(n) f(n) = O(g(n))
=>f(n) grows no faster than g(n) (there exists no and c, st. for all n>= no, f(n) <= cg(n) )
f(n) = (g(n)) =>f(n) grows at least as fast as g(n) (there exists no and c, st. for all n>= no, f(n) >= cg(n) ) F(n) = (g(n)) => f(n) grows at approximately the same rate as g(n) (there exists no ,c1 and c2, s.t. for all n>= no, f(n) <= c1g(n) and f(n) >= c2g(n) )
Sources
Computer Algorithms
Sara Baase, Allan Van Gelder