Algorithms

Class
Lectures: Mon, Wed 5:30 PM - 6:45 PM, 1001F (Hunter North)
Professor
Saad Mneimneh, HN 1090L
Office hours: Mon 3:00 PM - 5:00 PM (might change).



Textbooks
Introduction to Algorithms, CLRS
Topics to be covered: Insertion sort, merge sort, asymptotic notation, Strassen's algorithm, Growth of functions, O notation and others, solving recurrences, recursive tree method, substitution method, Master method, Quicksort, randomized algorithms, probabilistic analysis, indicator random variables and expectations, heapsort, sorting in linear time, median and order statistics, hash tables, binary search trees, red black trees, augmenting data structures, dynamic programming, greedy algorithms, amortized analysis, disjoint sets data structure, minimum spanning trees, Krusgal and Prim algorithm, short path algorithms, Bellman-Ford, Dijkstra, all pairs shortest path, Floyd Warshall, difference constraints, BFS, DFS, topological sort, connected components.

All the documents posted on this website, including notes, lectures, and homework assignments, are subject to copyright. These document are the property of the author. It is ILLEGAL to distribute these documents or post them on ANY third party websites, such as chatgpt, coursehero, chegg, coursicle, studocu, studyblue, brainspace, kahoot, quizizz, reply, quizlet, tutor, stuvia, discord,youtube, facebook, instagram, X (twitter), etc... Really ANY website, including within the Hunter College domain. Any electronic document related to my courses (including pictures of documents you take yourself and any other sort of reproduction) that is accessible online must be on this site under www.cs.hunter.cuny.edu/~saad/

Lectures (will follow these closely from previous offering)
(Sections are based on 3rd Edition)

PART I (Algorithmic analysis)

Introduction to algorithmic analysis and recurrences of divide and conquer
- Lecture 1: Insertion sort, pseudocode. Section 2.1 Insertion sort
- Lecture 2: Analysis, asymptotic notation, merge sort, Strassen's alg. Sections 2.2 Analyzing algorithms, 2.3 Designing algorithms, 4.2 Strassen's algorithm for matrix multiplication.
Formal way of dealing with asymptotics, O, Omega, and Theta, and methods for solving recurrences asymptotically
- Lecture 3: Growth of functions, Chapter 3
- Lecture 4: Solving recurrence equations, recursive tree, substitution method, Master method. Sections 4.3, 4.4, and 4.5.
A flavor of randomized algorithms and average performance
- Lecture 5: Quicksort, Sections 7.1, 7.2, 7.3, 7.4.1, and Ex 7-2.
--- we are here ---
- Lecture 6: Randomized algorithms and indicator R.V. Sections 5.1, 5.2, 5.3, and 7.4.2.
Heaps and priority queues
- Lecture 7: Heapsort and priority queues using heaps. Chapter 6.
Sorting in linear time and order statistics
- Lecture 8: Sorting in linear time, counting sort, radix sort, and bucket sort. Chapter 8.
- Lecture 9: Order statistics in linear time, Chapter 9, Sections 9.1, 9.2, and 9.3.

PART II (Data structures)

Hash tables
- Lecture 10. Hashing. Chapter 11, Sections 11.2, 11.3, and Pr 11-4.
- Lecture 11 Continue with Hashing, open addressing, perfect hashing. Chapter 11, Section 11.4 and 11.5.
Binary search trees, balanced trees, and skip lists
- Lecture 12 Binary search trees, chapter 12.
- Lecture 13 Red-black trees and skip lists, Chpater 13, Sections 1, 2, and 3, focus on the 3 cases for insertion.
- Lecture 14 Skip lists and Augmenting red-black trees, interval trees. Chapter 14.
Other algorithmic paradigms
- Lecture 15 Dynamic programming (memoization), Chapter 15 sections about LCS and optimal BST.
- Lecture 16 Greedy algorithms. Chapter 16 Sections 1 and 2. Chapter 23 Section 1 and Prim's alg. in Section 2.

PART III (Graph algorithms)

Minimin spanning tree and amortized time
- Lecture 17 Krusgal's alg. Disjoint sets, Amortized time analysis, Chapter 23 Section 23.2, Chapter 21 Sections 21.1, 21.2, Chapter 17, Sections 17.1
- Lecture 18 Continue with Amortized Analysis, Chapter 17, Sections 17.2, 17.3, 17.4.
BFS, DFS, and shortest path
- Lecture 19 BFS and single source shortest path, Bellman-Ford, Dijkstra.
- Lecture 20 DFS, topological sorting of DAGs, Sections 22.3 and 22.4 (I don't cover the results rigorously as in the book, such as the use of the white path theorem).
More graph algorithms
- Lecture 21 Connected components, and strongly connected components.
- Lecture 22 All-pairs shortest paths. Sections 25.1, 25.2, and 24.4.

Homework
Homework 1 Due 2/4/2026
Homework 2 Due 2/11/2025

Grading policy (subject to change)
- Homework 20%
- Test 1 20%
- Test 2 20%
- Final 30%
- Report 10%