Lecture 15
Learning objectives
After this class, you should be able to:
- Given a set of activities, their start times, and their end times, give an optimal solution to the activity selection problem.
- 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.
- Given a greedy strategy, give a counterexample to show that it is not optimal.
Reading assignment
- Lectures 15-17 slides.
- CLR: Sections 16.1 - 16.2.
- CLR: Section 16.3, pages 428-429.
Exercises and review questions
- Questions on current lecture's material
- Exercise 16.1-4. (Propose some greedy strategies on the discussion board and either give counter-examples, or prove them correct.)
- Exercise 16.2-2.
- Questions on next lecture's material
- (Post your solution on the discussion board) Give a set of characters and variable length code for each, so that a string representing a sequence of these characters can be uniquely decoded.