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

CS140 - Spring 2008
MW 2:45-4:00 in Millikan 134
Prof. Chen

8/12/2008: 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.


News

Please check here regularly for assorted announcements. You are responsible for being aware of any/all information posted here.
  • 5/10/2008: No office hours tomorrow (Sunday, 5/11).
  • 4/21/2008: No problem set due Wednesday (4/23).
  • 3/22/2008: No office hours (either at Pomona or HMC) tomorrow (Sunday 3/23).
  • 2/27/2008: I'm cancelling my office hours on Sunday 3/2. Instead I will have office hours on Friday 2/29 from 1:15-3:30.
  • 2/18/2008: The first midterm will be handed out in class on Wednesday, 2/27 and will be due at the beginning of class the following Monday (3/3). It's a timed two-hour exam and will be open 1 double sided page of handwritten notes but closed everything else.
  • There will be at least one TA available at the Platt Campus Center at HMC (campus map) from 9PM until midnight on Sundays, and from 8-10PM on Tuesdays.
  • 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). Grades will be based primarily on problem sets and exams, but participation will also be factored in.

    The prerequisites for the class are cs55/math55 and cs62/cs70. Exceptions will be made for students who have taken an advanced math course and cs52/cs60, but not cs70.

    The lectures are on Mondays and Wednesdays from 2:45-4:00 in Millikan 134.

    The textbook is Introduction to Algorithms, 2nd Edition by Cormen, Leiserson, Rivest, and Stein. It should be available at Huntley bookstore. Note that you will not need the CD that comes packaged with some versions of this book.

  • Administrivia <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 (Wed) 1/23 introduction
    administrivia
    review
    sample.tex, sample.pdf
    2 (Mon) 1/28 insertion sort
    loop invariants
    asymptotics
    2.1-2
    3.1-2
    ps1
    (Wed) 1/30 divide & conquer technique
    mergesort
    solving recurrences
    2.3, 4.1-2 ps2a
    3 (Mon) 2/4 more on solving recurrences
    quicksort
    4.3-4, 7.1-4 ps2b
    (Wed) 2/6 bounding problems
    matrix multiplication
    linear time sorting, order statistics
    8, 9, 28.2 ps3a
    4 (Mon) 2/11 data structures
    heaps and heapsort
    10, 6 ps3b
    (Wed) 2/13 amortized analysis 17 ps4a
    5 (Mon) 2/18 binary search trees
    balanced binary search trees
    red-black trees
    12, 13 ps4b
    (Wed) 2/20 disjoint sets using: linked lists, forests,
    union-by-rank, path compression
    21 ps5a
    6 (Mon) 2/25 mergeable heaps using: linked lists,
    heaps, binomial heaps
    19 ps5b
    (Wed) 2/27 review ps6a
    7 (Mon) 3/3 greedy algorithms 16 midterm
    (Wed) 3/5 dynamic programming 15 ps7a
    8 (Mon) 3/10 dynamic programming 15 ps7b
    (Wed) 3/12
    *** no class ***
    (Fri) 3/14
    5PM: blocks assignment due
    (Mon) 3/17
    *** no class: Spring Break ***
    (Wed) 3/19
    9 (Mon) 3/24 bfs, dfs, topological sort,
    strongly connected components
    22
    (Wed) 3/26 minimum spanning trees 23 ps8a
    10 (Mon) 3/31 single source shortest paths:
    Bellman-Ford, Dijkstra's
    24 ps8b
    (Wed) 4/2 all pairs shortest paths:
    Floyd-Warshall, Johnson's
    25 ps9a
    11 (Mon) 4/7 network flow
    Ford-Fulkerson
    26 ps9b
    (Wed) 4/9 review ps10a
    12 (Mon) 4/14 network flow
    min-cut max-flow, Edmunds-Karp
    26 midterm
    (Wed) 4/16 linear programming 29 ps11a
    13 (Mon) 4/21 linear programming, integer linear programming
    introduction to computational complexity
    34.1-4 ps11b
    (Wed) 4/23 P, NP, NPC
    polynomial time reductions
    NPC reductions
    34.5
    14 (Mon) 4/28 NPC reductions 34.5 ps12b
    (Wed) 4/30 approximation algorithms
    wrap-up, evaluations
    35.1-2 ps13a
    15 (Mon) 5/5 review ps13b
    (Wed) 5/7 class cancelled for HMC CS presentations

    The take-home final must be turned in by 5PM on Wednesday 5/14.

    Problem Sets

  • ps1, due 2:45PM on 1/28 <tex> <pdf>
    Business by numbers, September 13, 2007. The Economist.
  • ps2a, due 2:45PM on 1/30 <tex> <pdf>
  • ps2b, due 2:45PM on 2/4 <tex> <pdf>
  • ps3a, due 2:45PM on 2/6 <tex> <pdf>
  • ps3b, due 2:45PM on 2/11 <tex> <pdf>
    Sample input/output files for problem 1(d):
  • stock10.in, stock10.out
  • ps4a, due 2:45PM on 2/13 <tex> <pdf>
  • ps4b, due 2:45PM on 2/18 <tex> <pdf>
  • ps5a, due 2:45PM on 2/20 <tex> <pdf>
  • ps5b, due 2:45PM on 2/25 <tex> <pdf>
  • ps6a, due 2:45PM on 2/27 <tex> <pdf>
  • ps7a, due 2:45PM on 3/6 <tex> <pdf>
  • ps7b, due 2:45PM on 3/10 <tex> <pdf>
  • programming problem set, due 5:00PM on 3/14 <tex> <pdf>
    Sample input/output files:
  • blocks10.in, blocks10.out
  • ps8a, due 2:45PM on 3/26 <tex> <pdf>
  • ps8b, due 2:45PM on 3/31 <tex> <pdf>
  • ps9a, due 2:45PM on 4/2 <tex> <pdf>
  • ps9b, due 2:45PM on 4/7 <tex> <pdf>
  • ps10a, due 2:45PM on 4/9 <tex> <pdf>
  • ps11a, due 2:45PM on 4/16 <tex> <pdf> <pdf figure for problem 1>
  • ps11b, due 2:45PM on 4/21 <tex> <pdf>
  • ps12b, due 2:45PM on 4/28 <tex> <pdf>
  • ps13a, due 2:45PM on 4/30 <tex> <pdf>
  • ps13b, due 2:45PM on 5/5 <tex> <pdf> <pdf figure for problem 3>

  • 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 sample.tex that creates the file <sample.pdf> (by running "pdflatex sample.tex")
  • A gentle introduction to TeX by Laura Tallman and Michael Kozdron.
  • The Not So Short Introduction to LaTeX2e, also known as LaTeX2e in 139 minutes by Oetiker, Partl, Hyna, and Schlegl. (This is an evolving document, at the moment they're on version 4.20, dated May 2006.)
  • Information specific to running TeX on the DCI systems is here, and information on TeX distributions can be found here.

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