CSCE 411 Lecture 3

From Notes
Jump to navigation Jump to search
Lecture Slides

« previous | Friday, August 31, 2012 | next »


Time Complexity

We want to asymptotically count the number of operations independent of compilers and optimization settings.

Sad notation:

  • f=O(g)fO(g)
  • O(f)=O(g)O(f)O(g)

Big-Oh

Let g: be a function.

Then O(g) is the set of functions:

O(g)={f:u>0 n0 nn0 |f(n)|u|g(n)|}


Little-Oh

o(g)={f:|limn|f(n)||g(n)|=0}

It follows that o(f)O(f)


Big-Ω

Ω(g)={f:d>0 n0 nn0 d|g(n)||f(n)|}

Big-Θ

Θ(g)={f:u,d>0 n0 nn0 d|g(n)||f(n)|u|g(n)|}


Corrected Proof of Sorting Lower Bound

2hn!log22hlog2(n!)=log2(n(n1)(2)(1))hlog2(n!)log2((n2)n2)hn2log2(n2)=n2log2nn2log22hΩ(nlogn)