[ Course Schedule | Final | Homework Assignments | Resources ]
Instructor: David Eng (email: davideng at cs)
Location and time: Tuesday and Thursday 9:30 to 11:20 a.m., Gates B3
Sign up on Piazza for discussions and announcements.
We strongly encourage discussion and asking questions on Piazza. Questions to the course staff (that are not addressed to a specific person) can be sent using a private post in Piazza.
This course will cover the basic approaches and mindsets for analyzing and designing algorithms and data structures. Topics include the following: Worst and average case analysis. Recurrences and asymptotics. Efficient algorithms for sorting, searching, and selection. Data structures: binary search trees, heaps, hash tables. Algorithm design techniques: divide-and-conquer, dynamic programming, greedy algorithms, amortized analysis, randomization. Algorithms for fundamental graph problems: minimum-cost spanning tree, connected components, topological sort, and shortest paths. Possible additional topics: network flow, string searching.
Prerequisites: CS 103 or CS 103B; CS 109 or STATS 116.
Requirements: 6 homework assignments (60%) and a final exam (40%).
There will be three late days. (max of 2 per assignment).
Sean Choi, yo2seol at stanford
Braden Hancock, bradenjh at stanford
Helen Jiang, helennn at stanford
Nishith (Nish) Khandwala, nishith at stanford
Sydney Li sydli at stanford
Barak Oshri boshri at stanford
Topics and readings for future lectures are tentative and may be changed as the course proceeds. The readings refer to the 3rd edition of CLRS (see Resources below), but older editions should be fine as well.
Algorithmic Analysis, Divide and Conquer I [Slides] [Sorting Notes] CLRS: Ch. 2.3, 3
Divide and Conquer II [Slides] [Recurrence Notes] [Select-k Notes] CLRS: Ch. 3, 9
Homework 1 released
Trees, linear time sorting [Slides] [Linear-time Sorting Notes] [Trees Notes] CLRS: Ch. 8.1, 8.2, 12
Homework 1 due
Homework 2 released
Randomized Algorithms I [Condensed Slides] [Slides] [Quicksort Notes] CLRS: Ch. 5, 7
Randomized Algorithms II [Condensed Slides] [Slides] [Hashing Notes] CLRS: Ch. 11
Homework 2 due
Homework 3 released
Graph Algorithms I [Condensed Slides] [Slides] [DFS/BFS Notes] [Dijkstra's Notes] CLRS: Ch. 22, 24.1, 24.3
Graph Algorithms II [Slides] [Strongly Connected Components Notes]
Homework 3 due
Homework 4 released
Greedy Algorithms I
Greedy Algorithms II
Homework 4 due
Homework 5 released
Dynamic Programming I
Dynamic Programming II
Homework 5 due
Homework 6 released
Amortized Analysis, Approximation Algorithms
Homework 6 due
What's Next; Final Review
Midterm: There's no midterm.
Final: Friday, August 18 (Location TBD, 8:30 a.m. to 11:30 a.m.)
The final is closed-book. In the final, you are allowed to bring two letter-sized double-sided page of notes that you have prepared yourself.
The main textbook we use is:
Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein, Introduction to Algorithms, 3rd Edition, MIT Press
The book is available online through the Stanford library.
We will also occasionally use:
Jon Kleinberg, Éva Tardos, Algorithm Design, Pearson/Addison-Wesley
Sanjoy Dasgupta, Christos Papadimitriou, Umesh Vazirani, Algorithms, McGraw-Hill Education
We strongly recommend typesetting solutions to the homework assignments using LaTeX. LaTeX provides a convenient way to produce high-quality documents and it is the standard used for typesetting computer science papers.
Guide: An introduction to LaTeX can be found here. Other guides can be found at Wikibooks and NYU.
Online environments: If you do not wish to install LaTeX, ShareLaTeX and Overleaf are online environments that compile previews of your documents as you type and allow you to share documents with collaborators (this feature won't be useful in this course, though). As a Stanford student, you get a free Overleaf Pro account.
LyX: LyX is a version of LaTeX with graphical interface.
Finding mathematical symbols: The introduction mentioned above contains a table of mathematical symbols in LaTeX. Alternatively, consider Detexify.