[ news | information | lectures | problem sets | links ]

CS140 - Spring 2005
TR 2:45-4:00 in Andrew 157
Prof. Chen

5/17/2005: I've archived all of the notes and problem sets (ie, most of the links below don't work) and am only leaving up the syllabus for reference. If you're looking for the material, you may be able to find a link to a more recent offering of the class here or here.


Please check here regularly for assorted announcements. You are responsible for being aware of information posted here.
  • April 14: The final will be a take-home exam. It will be closed book, although you can use 2 doublesided 8.5-by-11 inch pages of notes that you have prepared in advance. After getting the exam from me, you will have 24 hours to finish it and to return it to me. Seniors must take the final between 4PM on 4/28 and 2:45PM on 5/3. Everyone else must take it between 4PM on 5/3 and 5PM on 5/11.
  • April 12: Please don't talk about the second midterm with anyone until after 8PM on Wednesday 4/13.
  • April 6: I will have office hours 4-5PM tomorrow (Thursday 4/7).
  • March 25: The second midterm will be handed out at the end of class on Thursday 4/7 and will be due at the beginning of class the following Tuesday.
  • March 10: Test files for the block program are here
  • March 2: Brian will not have office hours next week (3/9).
  • Feb 23: There's no class tomorrow, 2/24.
  • Feb 21: The first midterm will be handed out at the end of class on 2/22. It must be turned in (either given to Kathy Sheldon or put in my mailbox in the math/cs office . . . under my office door is unacceptable) by 2:45PM on 2/24.
  • Feb 21: Brian will not have office hours on 2/23.
  • Jan 24: The "verbatim" environment in LaTeX may be useful for formatting pseudocode.
  • Jan 20: Dan will have office hours 8:00-10:00 on Monday evenings in Linde lounge.
  • Jan 19: Brian will have office hours 8:15-9:45 on Wednesday evenings in Andrew 252.
  • Jan 19: Revised ps1a (with corrected problem 1d) posted.
  • Jan 18: The grutors for the class are Brian Young and Dan Halperin. Time/location of office hours are TBD.
  • Information

    CS140 is an introduction to algorithm design and analysis techniques. The course covers basic techniques used to analyze algorithms, basic techniques used in designing algorithms, and important classical algorithms. The goal is to help you understand how to apply all of the above to designing solutions for real-world problems (a skill that you will practice throughout the semester).

    The prerequisites given in the catalog are incorrect. They should have been given as cs55/math55 and cs70 (though exceptions will be made for students who have taken an advanced math course and cs52/cs60, but not cs70).

    The lectures are on Tuesdays and Thursdays from 2:45-4:00 in Andrew 157.

    The textbook is Introduction to Algorithms, 2nd Edition by Cormen, Leiserson, Rivest, and Stein. (It's available at Huntley bookstore.)

  • Administrivia <ps><pdf>
  • Lectures

    Any topic that's listed for a date in the future should be taken as tentative. Any topic that's listed for a date at least 2 days in the past is what was actually covered in that lecture.

    Week Date In class Reading Assignment due
    1 (Tue) 1/18 introduction, administrivia, review
    (Thu) 1/20 loop invariants
    2 (Tue) 1/25 divide & conquer technique
    solving recurrences
    2.3, 4.1-2 ps1b
    (Thu) 1/27 master method
    worst/average/best case analysis
    4.3-4, 7.1-4 ps2a
    3 (Tue) 2/1 bounds, linear time sorting
    order statistics
    8, 9 ps2b
    (Thu) 2/3 data structures, heaps 10, 6 ps3a
    4 (Tue) 2/8 amortized analysis 17 ps3b
    (Thu) 2/10 binary search trees
    red-black trees
    12, 13 ps4a
    5 (Tue) 2/15 AVL trees, disjoint sets 13, 21 ps4b
    (Thu) 2/17 mergable heaps 21 ps5a
    6 (Tue) 2/22 review, miscellaneous ps5b
    (Thu) 2/24 No class midterm
    7 (Tue) 3/1 greedy algorithms 16 ps6
    (Thu) 3/3 dynamic programming 15 ps7a
    8 (Tue) 3/8 dynamic programming 15 ps7b
    (Thu) 3/10 intro to graphs, bfs, dfs B.4, 22.1-3 block program
    9 (Tue) 3/15
    No class - Spring Break
    (Thu) 3/17
    10 (Tue) 3/22 strongly connected components
    topological sort
    22.4-5 ps8
    (Thu) 3/24 minimum spanning trees 23 ps9a
    11 (Tue) 3/29 single source shortest path 24 ps9b
    (Thu) 3/31 all pairs shortest path 25 ps10a
    12 (Tue) 4/5 network flow 26 ps10b
    (Thu) 4/7 review ps11a
    13 (Tue) 4/12 network flow 26 midterm
    (Thu) 4/14 linear programming 29 ps12a
    14 (Tue) 4/19 introduction to computational complexity
    polynomial time reductions
    34.1-34.3 ps12b
    (Thu) 4/21 lots of reductions 34.3-34.5 ps13a
    15 (Tue) 4/26 reductions, approximation algorithms 34, 35 ps13b
    (Thu) 4/28 approximation algorithms 35 ps14a
    16 (Tue) 5/3 review

    Problem Sets

  • PS1a handed out 1/18, due 2:45PM 1/20. Note: must be LaTeXed.
    <tex> <ps> <pdf>
    Note: this is a corrected version posted 9:45AM on January 19th.
  • PS1b handed out 1/20, due 2:45PM 1/25. Note: must be LaTeXed.
    <tex> <ps> <pdf>
  • PS2a handed out 1/25, due 2:45PM 1/27.
    <tex> <ps> <pdf>
  • PS2b handed out 1/27, due 2:45PM 2/1.
    <tex> <ps> <pdf>
  • PS3a handed out 2/1, due 2:45PM 2/3.
    <tex> <ps> <pdf>
  • PS3b handed out 2/3, due 2:45PM 2/8.
    <tex> <ps> <pdf>
  • PS4a handed out 2/8, due 2:45PM 2/10.
    <tex> <ps> <pdf>
  • PS4b handed out 2/10, due 2:45PM 2/15.
    <tex> <ps> <pdf>
  • PS5a handed out 2/5, due 2:45PM 2/17.
    <tex> <ps> <pdf>
  • PS5b handed out 2/17, due 2:45PM 2/19.
    <tex> <ps> <pdf>
  • PS6 handed out 2/22, due 2:45PM 3/1.
    <tex> <ps> <pdf>
  • PS7a handed out 3/1, due 2:45PM 3/3.
    <tex> <ps> <pdf>
  • Block programming assignment handed out 3/1, due 5PM 3/11.
    <tex> <ps> <pdf>
    Test files here
  • PS7b handed out 3/3, due 2:45PM 3/8.
    <tex> <ps> <pdf>
  • PS8 handed out 3/10, due 2:45PM 3/22.
    <tex> <ps> <pdf>
  • PS9a handed out 3/22, due 2:45PM 3/24.
    <tex> <ps> <pdf>
  • PS9b handed out 3/24, due 2:45PM 3/29.
    <tex> <ps> <pdf>
  • PS10a handed out 3/29, due 2:45PM 3/31.
    <tex> <ps> <pdf>
  • PS10b handed out 3/31, due 2:45PM 4/5.
    <tex> <ps> <pdf>
  • PS11a handed out 4/5, due 2:45PM 4/7.
    <tex> <ps> <pdf>
  • PS12a handed out 4/12, due 2:45PM 4/14.
    <tex> <ps> <pdf>
  • PS12b handed out 4/14, due 2:45PM 4/19.
    <tex> <ps> <pdf>
  • PS13a handed out 4/19, due 2:45PM 4/21.
    <tex> <ps> <pdf>
  • PS13b handed out 4/21, due 2:45PM 4/26.
    <tex> <ps> <pdf>
  • PS14a handed out 4/26, due 2:45PM 4/28.
    <tex> <ps> <pdf>
  • Links

  • web site for the textbook. Note the list of errata.
  • complexity:
  • complexity zoo
  • NP compendium
  • some pages discussing LaTeX, which is the best way to format anything containing mathematical equations.
  • A simple latex document that creates the file <sample.pdf>
  • A fast introduction to LaTeX written by Tony Roberts.
  • The Not So Short Introduction to LaTeX2e, also known as LaTeX2e in 129 minutes by Oetiker, Partl, Hyna, and Schlegl. (This is an evolving document, at the moment they're on version 4.12, dated April 2003.)
  • A Very Quick Guide to Using LaTeX in Algorithms, provided for the fall 2004 version of algorithms at HMC.

  • "Computers do not solve problems, they execute solutions"
    --Laurent Gasser