- lecture
videos from CS 222A Fall 2007 Plus several supplemental videos from previous
courses.

- lecture
videos from CS 122A Fall 2010

- Course Syllabus

- A Running list of topics covered in lecture

- Introduction to complexity and rules of the game
- HW 1, due January 11. Read about late homeworks on the syllabus.
- Rant on induction - might be helpful if you are unsure about how to do inductive proofs
- Notes on using the Master Method to solve divide and conquer recurrence relations
- Different notes on solving recurrence relations and the Master method. There is an error in the sum given in Method 2. Instead of summing from 0 to 8, it should be from 0 to 7.
- Notes on Strassen's matrix multiplication method Use the ID and password given in class.
- There will be a discussion section on monday 5:10-6:00 in 118 Olson Hall, starting Jan. 10.
- A copy of the Kleinberg and Tardos book has been placed on 2hr reserve in Shields Library.
- Video of the second lecture: Strassen's fast matrix multiplication method
- Notes on adversary method for median finding.
- Balaji's office hours are: M 4-5, T 3-5 and Friday 3-5 in 55 Kemper Hall.
- Gusfield's office hours are Tuesday 11-12 and Wed. 2-3.
- For problem 3 on HW 1, you do not need to use FFT. Try to think of a direct divide and conqure method. However, the notion of convolution is useful. If you need FFT or convolution, go ahead and use it, because the completely direct divide and conqure method I had in mind is not working well.
- Homework 2, Due Tuesday Jan. 18
- Notes on Four Russians method
- There will be an optional discussion section on Monday Jan. 17 at 5pm in 1065 Kemper Hall. Note the location is not Olson hall because it will most likely be locked.
- Video of the lecture on the Four Russian's method.
- PDF slides on an Intro to DP, illustrated by the Maximum Sequence Alignment Problem This is similar to the sequence alignment problem discussed in the book, but in the book the problem is cast as a minimization problem rather than a maximization problem.
- Homework 3, Due Weds. Jan. 26
- A Perl program that computes the proposed counting solution for problem 3 in HW 3. I think this program computes the proposed solution. If you find that it does not, let me know.
- Solutions for HW 1.
- Solution to the unwrapping problem on HW 1
- Video from the lecture of January 25. Advanced alignment topics: optimal alignmentin linear space; alignment of circular strings faster than the obvious way. Sequence alignment in linear space without an increase in the asymptotic running time; alignment of circular sequences much faster than the straightforward way.
- Homework 4, Due Thursday Feb. 3 (extension until Tues Feb 8)
- The videoing on Friday Jan. 28 will be at 3:00 pm instead of 1:30. Sorry for the late notice.
- Solutions for HW 2.
- Midterm from CS222 Fall 2005. That class had a somewhat different selection of material and the midterm came at a different point in the quarter. So, these questions are not necessaryilly appropriate for our class. However, people asked to see an old exam in order to see the {\it style} of the questions. The style will be the same - conceptual questions whose answers mostly require proofs or compelling explanations. There will be no questions of the type "run algorithm X on data Y and show the result".
- Video of lecture on Minimum Cost Arborescence Class lectures on this subject were on Jan. 27 and Feb. 1
- A cleaner proof of the correctness of the min cost arborescence algorithm
- Homework 4 I have added some clarifying comments (marked with stars), and changed the space target from $O(n)$ to $O(n \log n)$ in one of the problems (marked with stars).
- For the midterm, please bring a bluebook to write your answers (If you have time to get one). Please do not use a bluebook with an engineering grid - it makes it hard to read. thanks.
- Solution to Problem 1 (now it should be there) and to the RNA problem from HW 3.
- Solution to midterm
- Homework 5 Due Tuesday Feb. 15.
- Midterm mean was 41.9, median 43.5, std. deviation 14.9. max possible 75.
- Homework 6 Due Thursday Feb. 24. Remember to justify your answers. A justification is either a proof or a convincing explanation.
- In the original problem 3 of HW 6, the problem should have asked you to prove that A is a subset of P, rather than the other way around. The current posted version of HW 6 has made this correction.
- Old Video on baseball and sports elimination numbers. This solves, through the use of network flow, the question of whether a team in elminated, or equivalently whether the team can either be the undisputed winner or tie for the most number of games won. The W* threshold theorem for all monotonic sports scoring schemes.
- New Video on Sports elimination numbers. This covers the W* threshold theorem (which was also covered in the previous video), and then the solution to the question of which teams team can be the *undisputed* winner. For any single team, we can determine, via network flow, whether it can be the undisputed winner (strictly winning more games than any other team) using a single network flow computation. Here we show that we can identify *all* the teams that can be the undisputed winner, each under a different scenario for the remaining games, using a single network flow computation after W* is known. However, the video does not show the actual network flow formulation. That is left as an exercise in HW 7.
- Homework 7 Due Thursday Feb. 31. Remember to justify your answers. A justification is either a proof or a convincing explanation.
- solutions to HW 4 All of the solutions are there now.
- Global Min Cut The lecture of March 1 is based on this material.
- Constant time least common ancestor The lecture of March 3 is based on this material.
- HW 8, Due Monday March 14. Problem 2 on this homework was changed and simplified March 7.
- I will not be able to have my Tuesday 11-12 office hours. Sorry for the late notice.
- Videos of two topics I had hoped to cover in this class but did not have time for. These will
not be on any exam; these are posted here for your enjoyment:

First lecture on how to find the connected components of a conflict graph in linear time.

Second lecture on how to find the connected components of a conflict graph in linear time.

Finding a suffix array in linear time. The next video shows how to compute the associated LCP array in linear time, and how this allows the construction of a suffix tree in linear time.

Finding the LCP (longest common prefix) array in linear. The LCP array, along with the suffix array for a string, allows linear-time solution to many string algorithms that can be solved in linear time using a suffix tree. The two arrays also allow the construction of a suffix tree in linear time.

- solutions to HW 5

- solutions to HW 6

- 2007 final exam Some of the questions relate to material we did not cover in this class. So if something looks completely unfamiliar, ignore it.
- Your graded HW 4 papers are available, in a hanging basket outside of my office 2125 Kemper Hall.
- A few solved questions about NP completeness From the final exam of CS 122, Fall 2010.
- The final exam will emphasize material not covered on the midterm. However material before the midterm is also fair and there might be some questions on that material also.
- Please bring a small blue book to the final exam, and use a sharp pencil or pen.

- solutions to HW 7

- The final exam is open book and notes, but as in the midterm, just the text from the class and materials distributed on the class site, and your own notes.
- Comments on, and some solution sketches to the final exam
- The final exam.