## Key information - Class Meetings: Mondays and Wednesdays, 2:00-3:15pm, Cantor 101. - Midterm Exam: **Wednesday, Oct 26** - Final Exam: **Monday Dec 19, 2:00-3:50pm, Cantor 101** - Instructor: [Oded Regev](http://www.cims.nyu.edu/~regev/); office hours: Wednesdays 12:45-1:45pm, WWH 303. - Course Assistant: Min Jae Song (mjs1168); office hours: Mondays 3:30-4:30pm, 60FifthAve 402. - Recitation 1 (section 004): Peter Fenteany (pf2184), Thursdays 2:00-3:15pm, Silv 405; office hours: Fridays 9:00-10:00am, WWH 410. - Recitation 2 (section 041): Eli Goldin (eg3293), Thursdays 2:00-3:15pm, online; office hours: Tuesdays 2:30-3:30pm, WWH 410. - Tutors: - Vishal Kumar: Wednesdays 10:00am-12:00pm, 60FifthAve 402; Thursdays 10:00am-12:00pm, online; Fridays 11:00am-12:00pm, online. - Leo Xu: Tuesdays 3:30-5:00pm, online; Thursdays 3:30-5:00pm, online; Fridays 1:00-3:00pm, WWH 705. - As this is a large class, we ask that you first try to post all questions on [Campuswire](https://campuswire.com/p/G36CFB791), and/or attend the tutoring sessions. Please email your course assistant (mjs1168) only as a last resort. The instructor and recitation leaders will not be able to respond to emails. ## Overview Reviews a number of important algorithms, with emphasis on correctness and efficiency. The topics covered include solution of recurrence equations, sorting algorithms, binary search trees, partitioning, graphs, spanning trees, shortest paths, connectivity, depth-first and breadth-first search, dynamic programming, and divide-and-conquer techniques. We will try to cover most of chapters 1-4, 6-8, 12, 15, 16, 22-25, 30, 31, 34 of [CLRS]. ## Prerequisites Data Structures (CSCI-UA 102); Discrete Mathematics (MATH-UA 120); and either Calculus I (MATH-UA 121) or Mathematics for Economics I (MATH-UA 211). Also at least one year of experience with a high-level language such as Python, C++, or Java; and familiarity with recursive programming methods and with data structures (arrays, pointers, stacks, queues, linked lists, binary trees). ## Resources - **Introduction to Algorithms, 3rd Edition, by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Cliff Stein**, published by MIT Press. Our main textbook. [Available online via NYU Libraries](http://proxy.library.nyu.edu/login?url=https://search.ebscohost.com/login.aspx?direct=true&db=nlebk&AN=2932690&site=ehost-live) - Algorithm Design by Jon Kleinberg and Eva Tardos, Published by Pearson. - [Lecture Slides](http://www.cs.princeton.edu/~wayne/kleinberg-tardos/pearson/) for Algorithm Design by Kevin Wayne, distributed by Pearson. ## Summary of lectures Class | Date&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Topics | Read and watch before class | Notes | Assignments --- | --- | --- | --- | --- | --- 1 | Sep 7 | Intro, logists, insertion sort, run time analysis | CLRS §1, §2.1, §2.2; Insertion sort [video1](https://www.youtube.com/watch?v=K4CuPzdiAIo), [video2](https://www.youtube.com/watch?v=EdIKIf9mHk0) and [demo1](https://www.lemmaplay.com/sort/insertion-sort.html) and [demo2 (click INS)](https://visualgo.net/en/sorting)| pp. 1.2-1.5 of [Lecture 1](lecture_1.pdf) | 2 | Sep 12 | Big-O notation, merge sort | CLRS §2.3,3; Merge Sort [video](https://www.youtube.com/watch?v=Pr2Jf83_kG0) and [demo (click MER)](https://visualgo.net/en/sorting); [Big-O video](https://www.youtube.com/watch?v=v4cd1O4zkGw) | [Lectures 2-6](lectures_2_6.pdf), slides 2-11 of [KT Chapter 5a](http://www.cs.princeton.edu/~wayne/kleinberg-tardos/pearson/05DivideAndConquer.pdf) | [HW1](hw1.pdf) 3 | Sep 14 | Analysis of merge sort, Quick Sort | CLRS §2.3, 4.3-4.6, 7; Quick Sort [video](https://www.youtube.com/watch?v=SLauY6PpjW4) and [demo (click QUI)](https://visualgo.net/en/sorting) | [Lectures 2-6](lectures_2_6.pdf), slides 2-11 of [KT Chapter 5a](http://www.cs.princeton.edu/~wayne/kleinberg-tardos/pearson/05DivideAndConquer.pdf) | 4 | Sep 19 | Finishing Quick Sort; Karatsuba's algorithm | CLRS §7 | [Lectures 2-6](lectures_2_6.pdf), slides 4-12 of [KT Chapter 5b](http://www.cs.princeton.edu/~wayne/kleinberg-tardos/pearson/05Multiplication.pdf) | [HW2](hw2.pdf) 5 | Sep 21 | Finishing Karatsuba, Closest pair in the plane | KT §5 | [Lectures 2-6](lectures_2_6.pdf), slides 21-34 of [KT Chapter 5a](http://www.cs.princeton.edu/~wayne/kleinberg-tardos/pearson/05DivideAndConquer.pdf) | 6 | Sep 26 | Finishing Closest Pair | CLRS §33.4 | [Lectures 2-6](lectures_2_6.pdf) | [HW3](hw3.pdf) 7 | Sep 28 | Median and order statistics in linear time | CLRS §9 | [Lectures 7-13](lectures_7_13.pdf) | 8 | Oct 3 | Lower bound for comparison sort | CLRS §8.1 | [Lectures 7-13](lectures_7_13.pdf) | [HW4](hw4.pdf) 9 | Oct 5 | Counting sort, Radix sort; Dynamic Programming: Fibonacci Numbers | CLRS §8.2, §8.3 | [Lectures 7-13](lectures_7_13.pdf) | 10 | Oct 11 | Dynamic Programming: Rod Cutting Problem | CLRS §15.1 | [Lectures 7-13](lectures_7_13.pdf) | [HW5](hw5.pdf) 11 | Oct 12 | Dynamic Programming: Longest Common Subsequence| CLRS §15.4, [visualization](http://lcs-demo.sourceforge.net/) | [Lectures 7-13](lectures_7_13.pdf) | 12 | Oct 17 | Dynamic Programming: LCS, Knapsack | CLRS §15.3-4; Demaine's [video lecture](https://youtu.be/ocZMDMZwhCY?t=2592)| [Lectures 7-13](lectures_7_13.pdf), slides 23-28 of [KT Chapter 6](http://www.cs.princeton.edu/~wayne/kleinberg-tardos/pearson/06DynamicProgramming.pdf) | [HW6](hw6.pdf) 13 | Oct 19 | Greedy: Interval scheduling (aka activity selection) | CLRS §16.1-2 | [Lectures 7-13](lectures_7_13.pdf), [Slides 1-10](http://athena.nitc.ac.in/~kmurali/Courses/Algos15A/interval.pdf) | [Practice midterm](practice_midterm.pdf) 14 | Oct 24 | Review of practice midterm and HW | | | 15 | **Oct 26** | Midterm - Good luck! | | | 16 | Oct 31 | Greedy - Huffman Code | 6 first minutes of video on [priority queues](https://youtu.be/B7hVxCmfPtM); CLRS §16.3 | [Lectures 16-22](lectures_16_22.pdf); Slides 1-17 of [KT Chapter 4.8](https://www.cs.princeton.edu/~wayne/kleinberg-tardos/pearson/04Huffman.pdf) | [HW7](hw7.pdf) 17 | Nov 2 | Greedy - Huffman Code | CLRS §16.3 | [Lectures 16-22](lectures_16_22.pdf); [KT Chapter 4.8](https://www.cs.princeton.edu/~wayne/kleinberg-tardos/pearson/04Huffman.pdf), and [advanced notes for further reading](https://cs.nyu.edu/~roweis/csc310-2005/notes/lec2x.pdf) | 18 | Nov 7 | Graphs, BFS | CLRS §22.1-22.2, [adj list and adj matrix visualization](https://visualgo.net/en/graphds), [visualization](https://visualgo.net/en/dfsbfs) | [Lectures 16-22](lectures_16_22.pdf) | [HW8](hw8.pdf) 19 | Nov 9 | DFS | CLRS §22.3; [video](https://youtu.be/AfSk24UTFS8) |[Lectures 16-22](lectures_16_22.pdf) | 20 | Nov 14 | DFS, edge classification, detecting acyclic graphs | CLRS §22.3 | [Lectures 16-22](lectures_16_22.pdf) | [HW9](hw9.pdf) 21 | Nov 16 | Topological sort, strongly connected components | CLRS §22.4,22.5 | [Lectures 16-22](lectures_16_22.pdf) | 22 | Nov 21 | Finishing SCC; Minimum Spanning Tree | CLRS §23.1; [demo](https://visualgo.net/en/mst?slide=1) | [Lectures 16-22](lectures_16_22.pdf) | [HW10](hw10.pdf) 23 | Nov 28 | MST safe edge theorem, Kruskal's algorithm | CLRS §23.2 | [Lectures 23-28](lectures_23_28.pdf) | [HW11](hw11.pdf) 24 | Nov 30 | Prim's algorithm | CLRS §23.2 | [Lectures 23-28](lectures_23_28.pdf) | 25 | Dec 5 | Dijkstra's SSSP algorithm | CLRS §24.3 and [video](https://www.youtube.com/watch?v=_qX5mIrAjtU) | [Lectures 23-28](lectures_23_28.pdf); [Prof. Shoup's demo](dijkstra_demo.pdf) | [HW12](hw12.pdf) 26 | Dec 7 | Floyd-Warshall APSP algorithm | CLRS §25.2 | [Lectures 23-28](lectures_23_28.pdf) | [Practice Final](practice_final.pdf) 27| Dec 12 | Computability, Wang tiling, the halting problem is uncomputable | CLRS §34 | [Lectures 23-28](lectures_23_28.pdf) | 28| Dec 14 | P vs. NP, NP completeness, Vertex Cover, Independent set, 3SAT, reductions, approximating Vertex Cover | CLRS §34, 35 | [Lectures 23-28](lectures_23_28.pdf) | | **Dec 19** | 2:00-3:50pm, loc: Cantor 101, Final - Good Luck ! ||| <!-- Bellman-Ford SSSP algorithm ; Chapter 24.1 of CLRS--> ## Course Policies ### Homework There will be weekly homework assignments. We prefer homework submissions typeset in LaTeX (you might want to use the [Overleaf templates](https://www.overleaf.com/read/tfcwggvpbfmq)) or Word. You are encouraged to insert scanned figures or illustrations. Scanned handwritten submissions will only be graded if *neatly written and perfectly legible*. Honors questions will be graded, but will not affect your grade in any way. Submission is through Gradescope. ### Grading Tentative grade split is 5% participation, 20% homework, 25% midterm, and 50% final exam. Participation includes both in class, and on BrightSpace. ### Late Submission Policy Late submissions of homework solutions will be graded with a 20% penalty per day of late submission. Solutions will not be graded if they are submitted later than two days after the specified deadline. ### Academic Integrity Please review the departmental [academic integrity policy](http://www.cs.nyu.edu/web/Academic/Graduate/academic_integrity.html). ### Collaboration We strongly encourage you to discuss assignments with your peers. However, all work that you submit must be your own. You must list all discussions you had. You **should not** consult previous years' students, code, assignments, etc. You may help other students and groups on specific technical issues but you must acknowledge such interactions. Interactions must be limited to groups of at most 3. ### Plagiarism **Anything** you use from other sources (other students, web, etc.) must be clearly acknowledged. Failure to do so will result in a zero grade for the submitted work and, except in cases of obvious mistakes, a University investigation. ### Laptops We discourage the use of laptops. Pen and paper are more efficient for taking notes, and less distracting to students around you. If you do decide to bring a laptop, we ask that you use it for taking notes only, and not browsing the web (even if it is related to the course). If you cannot follow this rule, we ask that you sit in the back row, so there are no students behind you to get distracted by the monitor. ### Participation Students are expected to attend every meeting of the class. Students are also expected to participate actively in course discussion, either in person or on Piazza. Participation will be taken into account in the final grade. ## Applicable University Policies ### Academic Integrity Work you submit should be your own. Please consult the [CAS academic integrity policy](https://cas.nyu.edu/content/nyu-as/cas/academic-integrity.html) for more information. Penalties for violations of academic integrity may include failure of the course, suspension from the University, or even expulsion. ### Religious Observance As a nonsectarian, inclusive institution, NYU policy permits members of any religious group to absent themselves from classes without penalty when required for compliance with their religious obligations. The policy and principles to be followed by students and faculty may be found in the [University Calendar Policy on Religious Holidays](http://www.nyu.edu/about/policies-guidelines-compliance/policies-and-guidelines/university-calendar-policy-on-religious-holidays.html) ### Disability Disclosure Statement Academic accommodations are available to any student with a chronic, psychological, visual, mobility, learning disability, or who is deaf or hard of hearing. Students should please register with the Moses Center for Students with Disabilities at 212-998-4980. > NYU's Henry and Lucy Moses Center for Students with Disabilities > 726 Broadway, 2nd Floor > New York, NY 10003-6675 > Telephone: 212-998-4980 > Voice/TTY Fax: 212-995-4114 > Web site: http://www.nyu.edu/csd