Introduction to Algorithms
November 17 – November 22, 2004
Massachusetts Institute of Technology
6.046J/18.410J
Professors Charles E. Leiserson and Ronald L. Rivest
Quiz 2
Quiz 2
This take-home quiz contains 5 problems worth 25 points each, for a total of 125 points.
Your
exam is due between 10:00 and 11:00
A
.
M
. on Monday, November 22, 2004, in 32-123.
Late
exams will not be accepted unless you obtain a Dean’s Excuse or make prior arrangements with
your recitation instructor. You must hand in your own exam in person.
The quiz should take you about 12 hours to do, but you have five days in which to do it. Plan
your time wisely. Do not overwork, and get enough sleep. Ample partial credit will be given for
good solutions, especially if they are well written. Of course, the better your asymptotic running-
time bounds, the higher your score. Bonus points will be given for exceptionally efficient or elegant
solutions.
Write-ups:
Each problem should be answered on a separate sheet (or sheets) of 3-hole punched
paper. Mark the top of each problem with your name, 6.046J/18.410J, the problem number, your
recitation time, and your TA. Your solution to a problem should start with a topic paragraph that
provides an executive summary of your solution.
This executive summary should describe the
problem you are solving, the techniques you use to solve it, any important assumptions you make,
and the running time your algorithm achieves.
Write up your solutions cleanly and concisely to maximize the chance that we understand
them.
Be explicit about running time and algorithms.
For example, don’t just say you
sort
numbers, state that you are using heapsort, which sorts the
numbers in
time in the
worst case. When describing an algorithm, give an English description of the main idea of the
algorithm. Use pseudocode only if necessary to clarify your solution. Give examples, and draw
figures. Provide succinct and convincing arguments for the correctness of your solutions. Do not
regurgitate material presented in class.
Cite algorithms and theorems from CLRS, lecture, and
recitation to simplify your solutions.
Part of the goal of this exam is to test engineering common sense. If you find that a question
is unclear or ambiguous, make reasonable assumptions in order to solve the problem, and state
clearly in your write-up what assumptions you have made. Be careful what you assume, however,
because you will receive little credit if you make a strong assumption that renders a problem trivial.
Bugs, etc.: