COP 4531: Lecture 17

Learning objectives

After this class, you should be able to:

  1. Given a set of activities, their start times, and their end times, give an optimal solution to the activity selection problem.
  2. Given a set of characters and their frequencies, construct the Huffman tree and determine the Huffman code for each character.
  3. Given a problem, give an optimal substructure property, prove this property, construct a greedy algorithm, prove its correctness and optimality, and derive the time complexity of your algorithm.
  4. Given a greedy strategy, give a counterexample to show that it is not optimal.

Reading assignment

  1. CLR: Sections 16.1 - 16.3.
  2. Review amortized analysis of vector inserts from COP 4530.

Exercises and review questions


Last modified: 25 Aug 2015