Lecture 6
Learning objectives
After this class, you should be able to:
- Given an algorithm and an operation to be counted, derive the number of those operations executed by the algorithm, as a function of the input size.
Reading assignment
- Chapter 2.
- Class notes.
- Lecture: Algorithm Analysis Examples.
- Pages 74-76.
Exercises and review questions
- Exercises and review questions on current lecture's material
- Prove that
high-low+1
decreases by a factor of at least 2
in each iteration of the binary search algorithm.
- Prove that
n3 + n
is O(n3)
directly from the definition of big-O. Show constants c
and N
that satisfy the definition.
- Questions on next lecture's material
- Write a small piece of code that inserts a few numbers into a STL
vector
of float
s and then output each number.
- Explain the operations on the STL
list
in the vlm.cpp
from lecture 4.
Last modified: 14 Aug 2012