Coordinates  T/Th, 1011:20am, LINC 302 [Registrar] [Canvas] [Slack] 
Instructor 
Liang Huang (huanlian@)

TAs  Tianshuo Zhou (zhoutian@), Apoorv Malik (malikap@) 
Office Hours  Instructor: T/Th, 11:3011:50am (KEC 2069) TAs: M 45pm & 5:306:30pm; W 5:306:30pm; F 45pm (KEC Atrium). Extra office hours available before exams. 
Textbooks 
[CLRS] Introduction to Algorithms, 3rd or 2nd edi. (default reference).
[KT] Kleinberg and Tardos, Algorithm Design (DP chapter online, all slides online) [R] Roughgarden, Algorithms Illuminated (videos and slides online) [DPV] Dasgupta, Papadimitriou, and Vazirani (DPV). Algorithms (full text online via berkeley) [E] Jeff Erickson. Algorithms, Etc. (full text online) How to Think Like a Computer Scientist: Learning Python (full text online) 
Grading (tentative)  Midterm (Thu, week 7): 25%, Final: 25%, Quizzes (Thu, weeks 2 & 4): 8+8=16%; background survey: 2%. picking up graded papers: 1%; postmidterm survey: 1%. optional HW11: (extra) 3%. Weekly homework: 3x8%+6%=30%. For each HW, any complete submission automatically gets 2%. The other 1% is based on blackbox testing of the specified coding problem. Coding must be done in Python 3. no late submission is accepted. Grading Curve: (>90 OR top 25%): A/A; (<70 AND bottom 25%): C+ or lower; others: B+/B/B. (i.e., at least 1/4 will get A/A and at most 1/4 will get C+ or lower). 
Prerequisites  Students are assumed to be familiar with Data Structures (CS 261) and fluent in at least one mainstream language (C/C++, Java, Python). We'll start with a brief review of Data Structures integrated with a Python tutorial. 
Other Policies 
Canvas is for announcements (you'll receive an email for each announcement I made on Canvas)
and checking grades,
and Slack is for discussions.
For technical questions, come to office hours.
Otherwise you can raise a question on Slack. 
Week  Topics  Homework  Quiz/Exam 
1  (Tue) Admin Python Tutorial (first 5 pages) quicksort analyses: bestcase \(O(n \log n)\); worstcase \(O(n^2)\) divideconquercombine array concatenation is \(O(n)\)
(Thu) quicksort <> BST (buggy qsort)  HW1 (msort, inversions, qsort>bst)  
2  (Tue)
discussions of HW1 quickselect hints on Quiz 1
(Thu)
longest path in binary tree [video 1] [video 2]  HW2 (qselect, longest)  Thu: Quiz 1 (covers HW1) 
3  (Tue)
hand out graded quiz1 discussions of HW2 \(k\) numbers closest to input query, sorted; Python bisect.bisect \(k\) numbers closest to input query, unsorted;
(Thu)
x+y=query: \(O(n^2)\)>\(O(n \log n)\)  HW3 (kclosest, two pointers, kmergesort)  
4  priority queue, lowerbound, datastream slides for nbest  HW4 (priority queue)  Thu: Quiz 2 
5  dynamic programming (DP): basics [slides]  HW5 (DP: part 1)  
6  dynamic programming (DP): advanced  HW6 (DP: part 2)  
7  midterm review problems [solutions]  no HW7  Thu: Midterm 
89  graph algorithms and their connections to DP;
Topological sort Viterbi algorithm Dijkstra algorithm  HW8HW9 (graphs)  
10  challenge problem and final review  HW10 (a problem connecting all topics)  
11 
FINAL Wed 6/14 24pm
same room, closed book, closed notes 
To prepare for coding interviews, you have to practice on some of the above (say, solving at least 20 problems on codeforces, with at least two from each topic). To prepare for ACM/ICPC, you have to practice a lot (solving at least 100 problems on zoj/poj).