CS 161: Design and Analysis of Algorithms – Spring 2016
Virginia Vassilevska Williams
- Time: Tuesdays and Thursdays 3-4:20p
- Location: NVIDIA Auditorium
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.
Introduction to network flows and graph matchings.
Before taking CS 161, it is important that you complete
CS 103 and CS 109/STATS 116, or the equivalents.
you should be comfortable with proofs, discrete mathematics,
basic graph and set theory, and introductory probability theory.
There will be two exams for the course: one midterm and one final.
The midterm will be on Tuesday, May 3th, in class: 3-4:20pm.
Midterm Solutions: [pdf]
The final exam will be on Saturday, June 4, 7-10pm at Dinkelspiel Auditorium,
as specified by the
There will NOT be an alternate final exam, so plan
Before working on the homework, please read the homework policy.
- Homework 6: [pdf], due May 27, 12pm. (Please follow this post for clarifications/updates. )
- Homework 5: [pdf], due May 20, 12pm. (
Please follow this post for clarifications/updates.
Last update: May 13th at 8:50pm.) Solution: [pdf]
- Homework 4: [pdf], due May 13, 12pm. Solution: [pdf]
- Homework 3: [pdf], due April 29, 12pm. (Clarification for Q2 is added to PDF as of 4/25 11am.) Solution: [pdf] (We updated solutions after the midterm -- last update: May 10, 10am.)
- Homework 2: [pdf], due April 22, 12pm. Solution: [pdf]
- Homework 1: [pdf], due April 15, 12pm.
(please see this post for a clarification on Q4-d.)
- Homework 0: [pdf], due April 8, 12pm. Solution: [pdf]
- Introduction, Why are you here? [pdf]
- MergeSort, Recurrences, Asymptotic Analysis [pdf]
- Divide And Conquer, Solving Recurrences, Integer Multiplication [pdf]
- Median and Selection [pdf]
- Quicksort [pdf]
- Sorting Lower Bounds and Counting Sort [pdf]
- Binary Search Trees, Red-Black trees [pdf]
- (More) Red-Black Trees and Hashing with Chaining [pdf]
- Open Addressing [pdf]
- Graphs, DFS and Topological Sort [pdf]
- Single Source Shortest Paths: BFS and Dijkstra's Algorithm [pdf]
- Shortest Paths: (More) Dijkstra's, Bellman-Ford, Amortized Analysis and Incrementing a Binary Counter [pdf]
- Dynamic Programming: Floyd-Warshall, Longest Common Subsequence [pdf]
- Greedy Algorithms: Activity Selection, Minimum spanning tree: Boruvka, Kruskal, Prim [pdf]
- Minimum Cut: Karger's Algorithm [pdf]
- Max Flow / Min st-Cut, Ford-Fulkerson [pdf]
- Max Flow: Edmonds-Karp, Bipartite Perfect Matching [pdf]