## Key information
- Class Meetings: Mondays and Wednesday, 3:30-4:45PM, WWH 109
- Midterm Exam: **Oct 23, 2019, 3:30-4:45PM, WWH 109**
- Final Exam: **Dec 18, 4pm-5:50pm, 12 Waverly Place, Room G08 **
- Instructor: [Oded Regev](http://www.cims.nyu.edu/~regev/); office hour Wed 2:15pm-3:15pm, WWH 303
- Recitation 1: Min Jae Song, Tue 3:30-4:45pm, WWH 109; office hour Thu 5-6pm, Room 502 at 60 5th Ave
- Recitation 2: Ishan Agarwal, Tue 12:30-1:45PM, WWH 201; office hour Tue 2-3pm WWH 805
- Tutor 1: Sanjan Kumar, Mon and Fri 12:30-3pm, Room 502 at 60 5th Ave
- Tutor 2: Saisaketh Ramireddy, Tue 5-7pm Room C15 at 60 5th Ave and Fri 4:45-7:45pm, WWH201
- [Piazza forum for questions](https://piazza.com/nyu/fall2019/csciua0310). As this is a large class, we ask that you first try to post all questions on Piazza, and/or attend the tutoring sessions; please email your recitation leader only as a last resort. Questions regarding homework submission should go to the recitation leaders.
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.
The somewhat ambitious plan is to cover (most of) chapters 1-4, 6-8, 12, 15, 16, 22-25, 30, 31, 34 of [CLRS] (see below).
At least one year of experience with a high-level language such as Pascal, C, C++, or Java; and familiarity with recursive programming methods and with data structures (arrays, pointers, stacks, queues, linked lists, binary trees).
- **Introduction to Algorithms by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Cliff Stein**, published by MIT Press. Our main textbook.
- 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 (tentative)
Class | Date | Topics | Read and watch before class | Notes | Assignments
--- | --- | --- | --- | --- | ---
1 | Sep 4 | Intro, logists, insertion sort, run time analysis | CLRS §1, §2.1, §2.2; Insertion sort [video](https://www.youtube.com/watch?v=K4CuPzdiAIo) and [demo (click INS)](https://visualgo.net/en/sorting)| pp. 1.2-1.5 of [Lecture 1](http://www.cs.tau.ac.il/~shpilka/courses/alg2017/Lecture1.pdf) |
2 | Sep 9 | 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 11 | 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 16 | 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 18 | 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 23 | Finishing Closest Pair | CLRS §33.4 | [Lectures 2-6](lectures_2_6.pdf) | [HW3](hw3.pdf)
7 | Sep 25 | Median and order statistics in linear time | CLRS §9 | [Lectures 7-13](lectures_7_13.pdf) |
8 | Sep 30 | Lower bound for comparison sort | CLRS §8.1 | [Lectures 7-13](lectures_7_13.pdf) | [HW4](hw4.pdf)
9 | Oct 2 | Counting sort, Radix sort; Dynamic Programming: Fibonacci Numbers | CLRS §8.2, §8.3 | [Lectures 7-13](lectures_7_13.pdf) |
10 | Oct 7 | Dynamic Programming: Rod Cutting Problem | CLRS §15.1 | [Lectures 7-13](lectures_7_13.pdf) | [HW5](hw5.pdf)
11 | Oct 9 | Dynamic Programming: Longest Common Subsequence| CLRS §15.4, [visualization](https://www.cs.usfca.edu/~galles/visualization/DPLCS.html) | [Lectures 7-13](lectures_7_13.pdf) |
12 | **Oct 15** | 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) | [Practice Midterm](practice_midterm.pdf)
13 | Oct 16 | Greedy: Activity selection (aka interval scheduling) | CLRS §16.1-2 | [Lectures 7-13](lectures_7_13.pdf), [Slides 1-10](http://athena.nitc.ac.in/~kmurali/Courses/Algos15A/interval.pdf) | [HW6](hw6.pdf)
14 | Oct 21 | Review of practice midterm and HW | | |
15 | **Oct 23** | Midterm - Good luck! | | |
16 | Oct 28 | 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 | Oct 30 | 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 4 | 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 6 | DFS | CLRS §22.3; [video](https://youtu.be/AfSk24UTFS8) |[Lectures 16-22](lectures_16_22.pdf) |
20 | Nov 11 | DFS, edge classification, detecting acyclic graphs | CLRS §22.3 | [Lectures 16-22](lectures_16_22.pdf) | [HW9](hw9.pdf)
21 | Nov 13 | Topological sort, strongly connected components | CLRS §22.4,22.5 | [Lectures 16-22](lectures_16_22.pdf) |
22 | Nov 18 | 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 20 | MST safe edge theorem, Kruskal's algorithm | CLRS §23.2 | |
24 | Nov 25 | Prim's algorithm | CLRS §23.2 | | [HW11](hw11.pdf)
25 | Dec 2 | Dijkstra's SSSP algorithm | CLRS §24.3 and [video](https://www.youtube.com/watch?v=_qX5mIrAjtU) | [Prof. Shoup's demo](dijkstra_demo.pdf) | [HW12](hw12.pdf)
26 | Dec 4 | Floyd-Warshall APSP algorithm | CLRS §25.2 | |
27| Dec 9 | Computability, the halting problem, Tiling, Godel's incompleteness theorem, P, NP | Chapter 34 of CLRS | [Lecture 13](http://www.cs.tau.ac.il/~shpilka/courses/alg2017/Lecture13.pdf) |
28| Dec 11 | P vs. NP, NP completeness, Vertex Cover, Independent set, Clique, 3SAT, reductions | Chapter 34 of CLRS | [Lecture 13](http://www.cs.tau.ac.il/~shpilka/courses/alg2017/Lecture13.pdf) |
29 | **Dec 18** | Exam - Good Luck ! |||
## Course Policies
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/fvcscrvctmjg)) 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.
Tentative grade split is 5% participation, 20% homework, 25% midterm, and 50% final exam. Participation includes both in class, and on Piazza.
### 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).
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.
**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.
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.
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