## CS 460, Spring, 2010

## Lab 3: Greedy Algorithms

### Introduction

The purpose of this lab is to investigate applications of
the greedy method for algorithm design. You will do two problems with a bonus
problem as a third.

In addition to developing an algorithm for each problem, you
will need to prove that the algorithm solves the problem and give a complexity
analysis in terms of the problem size.

### Algorithm

Your description of the algorithm must be completely precise
and should include a description of the data representation used, so that
operations accessing the data can be included in the analysis. A precise
English description, precise pseudo-code, or a complete program in a language
of your choice is acceptable.

### Test Cases

You should provide test cases to demonstrate how your algorithms
work. The test case for each algorithm should be small, but without making the
application of the algorithm trivial. You should show how the step-by-step
application of your algorithm works. You might want to do two such test cases
to show differing outcomes of the algorithm when appropriate.

### Problems

The problems for this lab are taken from the exercises for
chapter 4 in K&T.

A. Show that the problems described in exercises 6 and 7 are
essentially the same problem, and provide an algorithm to solve this problem
(use the terminology from either exercise to describe your algorithm)

B. Either exercise 14 or exercise 15.

Bonus: Do the other of 14, 15.