Introduction to Algorithms
September 12, 2003
Massachusetts Institute of Technology
6.046J/18.410J
Professors Shafi Goldwasser and Silvio Micali
Handout 8
Problem Set 2
This problem set is due
in lecture
on
Wednesday, September 24.
Reading:
Chapters
2.3,
5.1–5.3,
8.1–8.3,
28.2,
30.1.
There are
four
problems. Each problem is to be done on a separate sheet (or sheets) of three
hole punched paper. Mark the top of each sheet with your name, the course number, the problem
number, your recitation section, the date, and the names of any students with whom you collabo
rated.
You will often be called upon to “give an algorithm” to solve a certain problem. Your writeup
should take the form of a short essay. A topic paragraph should summarize the problem you are
solving and what your results are. The body of your essay should provide the following:
1. A description of the algorithm in English and, if helpful, pseudocode.
English explana
tions should be used liberally in your pseudocode. For convenience, pseudocode may use
standard arithemetic and logical operations, as well as loops and data structures like arrays.
Pseudocode should be understandable to anyone who can program–it should
not
be ready to
compile!
2. At least one worked example or diagram to show more precisely how your algorithm works.
3. A proof (or indication) of the correctness of the algorithm.
4. An analysis of the running time of the algorithm.
Remember, your goal is to communicate. Graders will be instructed to take off points for convo
luted and obtuse descriptions.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
2
Handout 8: Problem Set 2
Problem 21.
Goldilocks and the
bears.
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '01
 CharlesE.Leiserson
 Algorithms, Goldilocks, Goldilock, SR ¡P

Click to edit the document details