CS 161
Design and Analysis of Algorithms
Fall 2014-2015

[Announcements] [Course Handouts] [Homework Sets][Frequently Asked Questions][General Information]





Handout Title





Course Information



Math Terms and Identities



Homework Advice



Lecture 1



Lecture 2



Lecture 3



Lecture 4



Lecture 5



Lecture 6



Lecture 7



Homework Sets


HW Title














Frequently Asked Questions

1. Must I e-mail my homework assignments?

Yes. Your homework must be submitted in electronic format (PDF only) and e-mailed to the TAs at Sending elsewhere will NOT be considered for grading. We will use your most recent send, or the version you indicate. If you decide to scan it and send it, and your handwriting is not legible or the image quality is poor you will receive significantly lower credit.
Please send with YOUR STANFORD EMAIL ADDRESS and subject your email "suid : HOMEWORK #homeworkid". Example "blakec : HOMEWORK #2"

Make sure that the total file size is below 5MB.

2. I have a tight work schedule, can I have some extension on homework due date?

Lateness of homeworks will be measured in terms of class periods (the time between two consecutive lectures is one class period). You have two grace periods which you can use at any time during the term without penalty. For a particular homework, you can use only one late period, i.e., submit late homework the following lecture. Once you run out your two late periods, homework will NOT be accepted. Each late homework should be clearly marked as "Late" on the first page.

General Information


3-5 units, TuTh 11-12:15, 420-040


There will be 2 quizzes on 10/16 and 11/11 in Hewlett 200. Both will take 75 minutes and will begin at the start of the class period.

During lecture time. Closed book.


Note that the Final exam schedules are decided by office of the university registrar. The final will be on December 10th, at 7:00 PM at Bishop Auditorium, Graduate School of Business. You can find the complete schedule here .
Due to instructor's travel schedule no alternative exams will be given.


Serge Plotkin

Location: Gates 472


Office hours: Thu 1:00-2:30pm
and by appointment

Teaching Assistants and Office Hours:

Amritha (Monday: 12:30 p.m. to 2:30 p.m., Gates B21)

Jessica (Monday: 7 p.m. to 9 p.m., Gates B26A)

James (Tuesday: 1:30 to 3:30, Gates B21)

Kyle (Tuesday: 4:00 p.m. to 6:00 p.m., Gates B26B)

Lawrence (Wednesday: 3:00 p.m. to 5:00 p.m., Gates B24A)

Romil (Wednesday: 11:00 a.m. to 1:00 p.m., Gates B21)

Ben (Friday: 9:00 a.m. to 11:00 a.m., Gates B21)



E-mail address for questions related to the class.
Rather than using the above e-mail addresses, you should use the following e-mail address, which goes to the instructor and the TAs:


The official prerequisites for this course are CS 103 and CS 109 (or Stats 116). If you have not taken CS109 or its equivalent, you should expect to do some independent reading during the course on topics including probability, random variables, expectation, and basic combinatorics.


The requirements for the course will be approximately six written assignments, an in-class midterm exam, and a final exam. Grading will be based on the written assignments (15%), first quiz (20%), second quiz (25%) and the final (40%), with class participation being factored in for borderline cases.

Each homework will be due at the end of lecture one week after it is distributed. Assignments MUST be e-mailed to You may either type up your homework using, e.g. LaTeX, or write it by hand, scan it, and compress it. We will be posting advice to Piazza shortly on how to compress a scan. Please ensure that your submission is less than 5MB to avoid overflowing our inbox. Lateness of assignments will be measured in terms of class periods (the time between two consecutive lectures is one class period). You will have two grace periods which you can use at any time during the term without penalty; you may only use one late period on any given assignment. Once these are exhausted, homework will not be accepted, unless prior arrangements have been made with the instructor. In no cases will homework be accepted after solution sets have been distributed.

Graded homeworks will be e-mailed to you.

One of the aims of this class is to teach you to reason about algorithms, describe them, and formally prove claims about them. In writing up your assignments, be as clear, precise, and concise as possible. Understandability will be an important factor in the grading of these assignments.

You are permitted and encouraged to work in groups of up to three students when discussing the homework assignments. If you do collaborate, however, you must still write up the solutions individually and clearly acknowledge anyone with whom you have discussed the problems. It will be considered an honor code violation to consult previous years' solutions or to search for the web for solutions.

There is no difference in terms of requirements to take this course for 3 or 5 units.

Required Textbooks:

Introduction to Algorithms, Third Edition by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest and Clifford Stein. MIT Press.
(Second edition can be used as well, but homeworks will be assigned from the third edition.) Here's a link to get second edition of the textbook from Stanford: Click here. Login with your Stanford ID and search "Introduction to Algorithms".

Optional Readings (highly recommended):

Algorithm Design by Jon Kleinberg and Eva Tardos

Data Structures and Algorithms by Alfred V. Aho, John E. Hopcroft, Jeffrey D. Ullman

Information for students with disabilities

CS161 Fall 2014
Comments and Suggestions: send to staff mailing list