CS 218: Design and Analysis of Algorithms
Fall Quarter, 2012
(Dec 13) homework 5 solution posted
(Dec 6) problems discussed in class posted
(Nov 28) network flow slides posted, hw3 posted, hw4 solution posted, final syllabus posted
(Nov 14) greedy slides updated
(Nov 13) hw4 posted, hw3 solution posted, dynamic programming slides posted
(Nov 8) Midterm and solution posted
(Oct 30) hw2 solution posted, hw3 posted, greedy slides updated, midterm syllabus posted, mock exam posted
(Oct 23) slides "divide and conquer" updated
(Oct 22) Hw1 solution posted
(Oct 16) Hw2 posted
(Oct 12) Python examples posted
(Oct 8) Entrance exam posted
(Oct 2) Hw1 posted
(Oct 1) Our TA is YiWen Yang
Lecture Schedule Resources Tutorials
Catalog description: CS 218. Design and
Analysis of Algorithms (4) Lecture, 3 hours; outside research, 3
hours. Prerequisite(s): CS 141. Study of efficient data structures and
algorithms for solving problems from a variety of areas such as
sorting, searching, selection, linear algebra, graph theory, and
computational geometry. Worstcase and averagecase analysis using
recurrence relations, generating functions, upper and lower bounds,
and other methods. UCR course schedule,
UCR course
catalog.
Instructor:
Stefano Lonardi (stelo AT cs.ucr.edu)
Office hours: Wednesday 10:3012noon. Office: Chung Hall 325.
Teaching Assistant:
YiWen Yang (yyang027@ucr.edu)
Office hours: Mondays 23pm. Location: Chung Hall 110.
Lectures:
TR, 11:10am12:30pm Chung Hall 142
Text Book:
Introduction to Algorithms (3rd Edition) by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Cliff Stein, MIT Press.
Prerequisites:
Graduate standing, undergraduate courses in algorithms and data structures.
Prerequisites by topic:
Discrete Math: asymptotic notation, basic summation formulas,
sets (operations on sets, relations, functions),
counting (permutations, sets, combinations, binomial coefficients),
probability (independence, random variable, expected value)
Basic Data Structures: array, list, queue, stack, binary search
trees, balanced binary search trees, heap
Sorting and Searching: quicksort, mergesort, heapsort, radixsort,
binary search
Graph algorithms: DFS, BFS, connected components, biconnected components,
transitive closure
Digraph algorithms: DFS, BFS, strongly connected components, topological sorting
Tentative list of topics
Intro to Analysis: recurrence relations, master theorem, amortized analysis
Pattern matching: brute force, KMP, tries and suffix trees
Greedy: task scheduling, factional knapsack, Huffman codes, Dijkstra, Prim, Kruskal
UnionFind: list and tree implementation, union by rank and path compression, analysis
Divide and conquer: lineattime selection, Strassen, FFT, Integer multiplication
Dynamic programming: Subset sum, LCS, matrix chain multiplication, FloydWarshall
Graph algorithms: Flow and matching
Numerical algorithms: primality testing, RSA
Data structures: binomial heaps and Fibonacci heaps, splay trees
Actual list of topics
Sep 27: Course overview, Analysis of Algorithms (127)
Oct 2: Analysis of Algorithms (2853) [HW1 posted]
Oct 4: Analysis of Algorithms (5461) [Entrance quiz]
Oct 9: Analysis of Algorithms (62end), Divide and Conquer (115)
Oct 11: Divide and Conquer (1635)
Oct 16: Divide and Conquer (3664) [HW1 due, HW2 posted]
Oct 18: Divide and Conquer (65end)
Oct 23: Greedy (133)
Oct 25: Greedy (3458)
Oct 30: Greedy (5979) [HW2 due, HW3 posted]
Nov 1: Greedy (80119)
Nov 6: Midterm Prep
Nov 8: [Midterm (80mins, in class, closed book, closed notes)]
Nov 13: Midterm review, Greedy (120end), [HW3 due, HW4 posted]
Nov 15: Dynamic Programming (126) guest lecture by Prof. Chrobak
Nov 20: Greedy (unionfind proof), Dynamic Programming (2735)
Nov 22: Thanksgiving
Nov 27: Dynamic Programming (36end)[HW4 due, HW5 posted]
Nov 29: Network Flow (1)
Dec 4: Network Flow (end)
Dec 6: Review
Dec 13: Final [HW5 due] & [Final (time 11:302:30pm, closed book, closed notes)]
Slides
Intro [PDF 2pages/slide]
Algorithm Analysis [PDF 2pages/slide]
Divide and Conquer algorithms [PDF 2pages/slide]
Greedy algorithms [PDF 2pages/slide, updated Oct 30]
Dynamic Programming algorithms [PDF 2pages/slide]
Network flow algorithms [PDF 2pages/slide]
Python
Python examples

Academic dishonesty: Cheating
will be strongly punished (typically
with an F in the course). Assignment
submissions must represent your
original work. Copying from any
sources (web, other books, past or
current students, etc.) is strictly
prohibited. While discussing highlevel ideas about
assignments together is
tolerated, pooling common answers
is not allowed. Be aware that all
exams will be scanned,
for comparison with exams submitted
for regrades. Also, be aware that
lying to an instructor in order to be
able to makeup a missed exam or in
other ways to obtain a better grade
can be treated as academic dishonesty.

Regrade policy: Regrade
requests must be submitted in
within two weeks of
the distribution of the graded
material. The entire
homework/test/assignment may be
regraded, not just the problem in
question, so the grade may go up or
down. Thus, think your regrade
requests through carefully. Recording errors should also be pointed out to
the instructor before the last class.

Final grades: Per university
policy, changes to your final grade
will be made only in the event
of a clerical error. Asking your
instructor how far you were from a
cutoff and what extra work you can do
to improve the grade is not
appropriate.

Communicating with the instructors
: When sending electronic
mail to the instructors or
graders, please include your full
name, student ID
number, and UCR email
address, so that we may properly
identify you (remember, many students
have similar names). Also, please try
to be polite and use reasonable
grammar and formatting.

Cell phones: During lectures
please turn off your
cell phone. During exams, cell phones
must not be visible (e.g., store them
inside a backpack).

Written Assignments: All
assignments and solutions will be
posted on the class homepage. Write
your full name with uppercase LAST
name, assignment number, student ID,
login. Write legibly: what cannot be
read will not be graded. Consider
typing the assignment if you
handwriting is hard to read. Written
assignments have to be submitted
before the beginning of the
class on the due date on the
instructor's desk. No
late assignment will be accepted. Any
problem with grading of a written
assignment should be addressed at the
latest two weeks after the
assignment is returned to you.