Lecture 7
Learning objectives
After this class, you should be able to:
- Define the big-O, big-Omega, and big-Theta notations.
- Given an algorithm, derive its asymptotic time complexity, and express it using the big-O notation.
- Prove simple properties of the big-o notation, such as those given in section 2.3.
- Given functions
f
and g
, prove or disprove that f = O(g)
. You should be able to do the proofs by directly using the definition, and also by using properties of big-O.
Reading assignment
- Read the note on complexity in www.cs.fsu.edu/~asriniva/courses/DS04/lectures/Lec6/complexity.html
- Section 2.2 - 2.7.
- Class notes.
Exercises and review questions
- Exercises and review questions on current lecture's material
- Prove, using induction, that
2n2 + 3n + 1 <4n2, n > 2
.
- Prove that
hi-lo+1
decreases by a factor of at least 2
in each iteration of the binary search algorithm presented in class.
- Chapter 2, exercise 2 a, d, and e.
- Chapter 2, exercise 3f.
- Chapter 2, exercise 4a.
- Prove that
n3 + n
is O(n3)
directly from the definition of big-O. Show constants c
and N
that satisfy the definition.
- Prove that
n3 + n
is O(n3)
using properties of big-O.
- Prove that
n - 1
is big-Omega(n
), directly from the definition of big-Omega.
- Prove that
n - 1
is big-Theta(n
), directly from the definition of big-Theta.
- Questions on next lecture's material
- None.
Last modified: 14 Sep 2004