CS 218: Design and Analysis of Algorithms
Fall Quarter, 2016
(Nov 29) Solution homework 8 posted
(Nov 29) Practice problems posted
(Nov 28) Network Flow slides updated
(Nov 27) Homework 7 solution posted
(Nov 21) Homework 8 posted, final syllabus
(Nov 17) Homework 6 solution
(Nov 17) Network Flow slides posted
(Nov 16) Dynamic programming slides updated
(Nov 14) Homework 7 posted
(Nov 9) Midterm (and solution) posted
(Nov 7) Practice problem posted
(Nov 2) Dynamic Programming slides posted
(Nov 1) Mock exam posted
(Oct 31) Homework 5 updated, homework 6 posted, midterm syllabus posted
(Oct 20) Greedy slides posted
(Oct 17) Homework 4 posted, and homework 3 solution posted
(Oct 12) Homework 3 posted, and homework 2 solution posted
(Oct 7) Homework 1 solution posted
(Oct 5) Divide and conquer slides posted, second homework posted
(Oct 4) Entrance exam posted
(Sep 28) First homework posted
(Sep 12) First lecture is Monday September 26th, 3:40pm
Catalog description: 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:405pm. Office: Chung Hall 325.
Teaching Assistant:
Sihuan Li (sli049 AT ucr.edu)
Sihuan Li's office hours: Thursday 10am11am. Location: Chung Hall 110.
Hui Yang (hyang028 AT ucr.edu)
Hui Yang's office hours: Tuesday 1pm2pm. Location: Chung Hall 110.
Lectures:
MW, 3:40pm5:00pm 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. Students without an undergraduate courses in algorithms (CS 141 equivalent) and basic data structures (CS 14 equivalent) will not allowed to enroll.
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
Divide and conquer: lineartime selection, Strassen, FFT, Integer multiplication
Randomized: selection in expected linear time, polynomial verification
Greedy: task scheduling, factional knapsack, Huffman codes, Dijkstra, Prim, Kruskal
UnionFind: list and tree implementation, union by rank and path compression, analysis
Dynamic programming: Subset sum, LCS, matrix chain multiplication, FloydWarshall
Graph algorithms: Network Flow and Bipartite Matching
Actual list of topics
M, Sep 26: Course overview, Analysis of Algorithms (125)
W, Sep 28: Analysis of Algorithms (2650) [HW1 posted]
M, Oct 3: Analysis of Algorithms (5160) [Entrance quiz (40mins, in class, closed book, closed notes)]
W, Oct 5: Analysis of Algorithms (6177) [HW1 due, HW2 posted]
M, Oct 10: Analysis of Algorithms (77end), Divide and Conquer/Randomized (134)
W, Oct 12: Divide and Conquer/Randomized (3559) [HW2 due, HW3 posted]
M, Oct 17: Divide and Conquer/Randomized (6085)
W, Oct 19: Divide and Conquer/Randomized (86end) [HW3 due, HW4 posted]
M, Oct 24: Greedy (129)
W, Oct 26: Greedy (3055) [HW4 due, HW5 posted]
M, Oct 31: Greedy (5676), UnionFind (7781)
W, Nov 2: UnionFind (8198) [HW5 due, HW6 posted]
M, Nov 7: Midterm Prep
W, Nov 9: [Midterm (80mins, in class, closed book, closed notes)]
M, Nov 14: Midterm review, UnionFind (99end), Dynamic programming (124)
W, Nov 16: Dynamic programming (2463) [HW6 due, HW7 posted]
M, Nov 21: Dynamic programming (64end), Network flow (126)
W, Nov 23: Network flow (26) [HW7 due, HW8 posted]
M, Nov 28: Network flow ()
W, Nov 30: Review [HW8 due]
F, Dec 9: 36pm[Final (180 mins, in class, closed book, closed notes)]
Slides
Intro [PDF 2pages/slide]
Algorithm Analysis [PDF 2pages/slide]
Divide and Conquer (and randomized) algorithms [PDF 2pages/slide]
Greedy algorithms [PDF 2pages/slide]
Dynamic Programming algorithms [PDF 2pages/slide]
Network flow algorithms [PDF 2pages/slide, updated]

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.

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.

Laptops, tablets and cell phones: During lectures
please turn off your
cell phone. During exams, all electronic devices
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. Assignment have to be typed
(figures can be hand drawn). 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.