Princeton University
Computer Science Department

Computer Science 226
Algorithms and Data Structures

Rob Schapire

Spring 2005

General Information | Schedule & Readings | Assignments | Whiteboard



due date





Tuesday, Feb. 1





Friday, Feb. 11

Pattern Recognition




Friday, Feb. 18





Friday, Feb. 25

Bin Packing




Tuesday, March 8

The Markovian Candidate




Tuesday, March 29

Word Searching
Results of tournament




Friday, April 8





Tuesday, April 19

Map Routing
Results of tournament

checklist exercises


Tuesday, May 3

Baseball Elimination

checklist exercises


Turning in assignments

Homework assignments will be a mix of written exercises and programming, with an emphasis on programming.  All parts of each assignment are due on the same date, as listed above.

The programming part of each assignment should be turned in electronically using the class whiteboard page by clicking on "Assignment Submission" and following the instructions.  To authenticate yourself, you will need to type your Princeton OIT Unix login and password.  (This will only work after you have completed HW#0.)  You will receive an email confirmation for each successful submission.  You can resubmit or unsubmit files as needed.  Be sure to test that your code compiles by pressing the "Run Script" button.

Each programming assignment also asks you to write a brief program report answering specific questions.  Contrary to earlier instructions, this program report should be submitted electronically using whiteboard, together with the the rest of the programming assignment.  The report should either be in plain ascii text, or in pdf.  Please do not submit any other formats (such MS word).  Your report should be in a file called either report.txt (if in plain text) or report.pdf (for pdf).  Be sure that files submitted in pdf will print okay.

Written exercises must be submitted in hard copy.  They can be submitted by placing in the envelope on the door of Eddie's office (103c CS building), or at the end of any class or precept.  Be sure to clearly indicate your precept on all written work.  If turning in after hours, please also indicate the day and time when submitted.

Programming assignments will generally be worth around 60 points.  Questions on the written exercises will typically be worth around 4 points each.

Grades will be posted using whiteboard.

Programming guidelines

Your code will be graded on correctness, efficiency, clarity and elegance.  Submit all of your source code for each assignment, as well as the program report (see above). Your code should conform to reasonable style guidelines.  Include your name and precept in every file you submit.  Use consistent indentation and white space as needed.  (All tabs will be converted to a fixed number of spaces, so be careful about mixing spaces and tabs.)  Comment every class, method, constructor and important variable as well as any sections of code whose purpose may be unclear.  No line should have more than 80 characters.

Please only use Java features which were available with version 1.4.2 or earlier.

Late policy

All assignments are due at 11:59pm on the due date.

Each student will be allotted seven free days which can be used to turn in homework assignments late without penalty.  For instance, you might choose to turn in HW#1 two days late, HW#4  three days late and HW#6 two days late.  Once your free days are used up, late homeworks will be penalized 25% per day.  (For instance, a homework turned in two days late will receive only 50% credit.)  Homeworks will not be accepted more than three days past the deadline, whether or not free days are being used.  Exceptions to these rules will of course be made for serious illness or other emergency circumstances; in these cases, please contact me as soon as you are aware of the problem.

If you are turning in a written homework after hours when no one is around to accept it, please clearly mark the day and time when it was turned in.  Failure to do so may result in the preceptors considering the homework to be submitted at the time when they pick it up (which might be many hours, or even a day or two after when you actually submitted it).


The collaboration policy for this course is based on the overarching objective of maximizing your educational experience, that is, what you gain in knowledge, understanding and the ability to solve problems. Obviously, you do not learn anything by copying someone else's solution. On the other hand, forbidding any and all discussion of course material may deprive you of the opportunity to learn from fellow students. The middle ground between these two extremes also needs to be defined with this basic principle in mind. Before working with another student, you should ask yourself if you would gain more or less (in terms of the educational experience) by working together or individually, and then act accordingly. Here are some specific guidelines based on this principle: