CS 218: Design and Analysis of Algorithms
Winter Quarter, 2014
(Mar 14) Problems discussed in class posted
(Mar 11) Final time/location CHANGED back to the original time/place
(Mar 10) Homework 4 solution posted
(Mar 8) Final syllabus posted
(Mar 4) Dyn Programming slides updated
(Mar 4) Network flow slides posted
(Mar 4) Homework 3 solution posted
(Mar 4) Homework 5 posted
(Feb 25) Dynamic Programming slides posted
(Feb 25) Midterm and solutions posted
(Feb 18) Problems presented in class posted
(Feb 18) Greedy slides updated
(Feb 10) Mock exam (midterm) posted w solutions
(Feb 10) Midterm syllabus posted
(Feb 10) Homework 2 solution posted
(Feb 3) Homework 3 posted
(Jan 28) Greedy slides posted
(Jan 28) Homework 1 solution posted
(Jan 23) Homework 2 posted
(Jan 16) Divide and conquer slides posted
(Jan 15) Entrance quiz (w solutions) posted
(Jan 10) Homework 1 posted
(Jan 10) Entrance exam slides posted
(Jan 1) Happy New Year
Lecture Schedule
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.
Instructor:
Stefano Lonardi (stelo AT cs.ucr.edu)
Office hours: Tuesday 3:404:40pm. Office: Chung Hall 325.
Teaching Assistant:
Rachid Ounit (rouni001 AT ucr.edu)
Office hours: Thursday 3:404:40pm. Location: Chung Hall 110.
Lectures:
TR, 2:10pm3:30pm MSE 103
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
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: lineartime selection, Strassen, FFT, Integer multiplication
Dynamic programming: Subset sum, LCS, matrix chain multiplication, FloydWarshall
Graph algorithms: Network Flow and Bipartite Matching
(time permitting) Numerical algorithms: primality testing, RSA
(time permitting) Advanced Data structures: binomial heaps and Fibonacci heaps, splay trees
Actual list of topics
Jan 7: Course overview, Analysis of Algorithms (127)
Jan 9: Analysis of Algorithms (2853) [HW1 posted]
Jan 14: Analysis of Algorithms (5463) [Entrance quiz]
Jan 16: Analysis of Algorithms (64end), Divide and Conquer (115)
Jan 21: Divide and Conquer (1628)
Jan 23: Divide and Conquer (2973) [HW1 due, HW2 posted]
Jan 28: Divide and Conquer (74end)
Jan 30: Greedy (129)
Feb 4: Greedy (3071, skipped Huffman codes)
Feb 6: Greedy (7288) [HW2 due, HW3 posted]
Feb 11: Greedy (89)
Feb 13: UnionFind (end)
Feb 18: Midterm Prep
Feb 20: [Midterm (80mins, in class, closed book, closed notes)][HW3 due, HW4 posted]
Feb 25: Midterm review, Dynamic Programming (124)
Feb 27: Dynamic Programming (2553)
Mar 4: Dynamic Programming (68end)
Mar 6: Network Flow (130)[HW4 due, HW5 posted]
Mar 11: Network Flow (31end)
Mar 13: Review
Mar 19: Final [HW5 due] & [Final (MSE 103, 8am11am, 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 Feb 18]
Dynamic Programming algorithms [PDF 2pages/slide, updated Mar 4]
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.