{"id":20086169,"url":"https://github.com/asarkar/algorithms-design-analysis","last_synced_at":"2025-10-04T18:51:25.301Z","repository":{"id":67174722,"uuid":"159627476","full_name":"asarkar/algorithms-design-analysis","owner":"asarkar","description":"Lecture videos and homework for Algorithms: Design and Analysis, Part 1, taught by Tim Roughgarden","archived":false,"fork":false,"pushed_at":"2023-07-30T10:05:48.000Z","size":60930,"stargazers_count":1,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-06T02:41:40.601Z","etag":null,"topics":["algorithms","coursera","data-structures","scala","stanford"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asarkar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-29T07:44:48.000Z","updated_at":"2023-07-30T06:36:02.000Z","dependencies_parsed_at":"2024-11-13T21:02:42.326Z","dependency_job_id":null,"html_url":"https://github.com/asarkar/algorithms-design-analysis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/asarkar/algorithms-design-analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asarkar%2Falgorithms-design-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asarkar%2Falgorithms-design-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asarkar%2Falgorithms-design-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asarkar%2Falgorithms-design-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asarkar","download_url":"https://codeload.github.com/asarkar/algorithms-design-analysis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asarkar%2Falgorithms-design-analysis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278358479,"owners_count":25973949,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","coursera","data-structures","scala","stanford"],"created_at":"2024-11-13T16:00:53.965Z","updated_at":"2025-10-04T18:51:24.788Z","avatar_url":"https://github.com/asarkar.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](https://github.com/asarkar/algorithms-design-analysis/actions/workflows/ci.yml/badge.svg)](https://github.com/asarkar/algorithms-design-analysis/actions/workflows/ci.yml)\n\nLecture videos and answers to homeworks for [Algorithms: Design and Analysis, Part 1](https://online.stanford.edu/courses/soe-ycsalgorithms1-algorithms-design-and-analysis-part-1) - an online course offered by Stanford University and taught by Prof. Tim Roughgarden.\n\n## Syllabus:\n\n### 1. Introduction\n  1.1 [Why Study Algorithms?](https://www.youtube.com/watch?v=yRM3sc57q0c)\n\n  1.2 [Integer Multiplication](https://www.youtube.com/watch?v=6u0Vaj4nn54)\n\n  1.3 [Karatsuba Multiplication](https://www.youtube.com/watch?v=JCbZayFr9RE)\n\n  1.4 [About the Course](https://www.youtube.com/watch?v=F-WS73Y_RU4)\n\n  1.5 [Merge Sort: Motivation and Example](https://www.youtube.com/watch?v=kiyRJ7GVWro)\n\n  1.6 [Merge Sort: Pseudocode](https://www.youtube.com/watch?v=rBd5w0rQaFo)\n\n  1.7 [Merge Sort: Analysis](https://www.youtube.com/watch?v=8ArtRiTkYEw)\n\n  1.8 [Guiding Principles for Analysis of Algorithms](https://www.youtube.com/watch?v=-yP11jqilwM)\n\n### 2. Asymptotic Analysis\n  2.1 [The Gist](https://www.youtube.com/watch?v=l-cNaKGc-yY)\n\n  2.2 [Big-Oh Notation](https://www.youtube.com/watch?v=QfRSeibcugw)\n\n  2.3 [Basic Examples](https://www.youtube.com/watch?v=5rZCkblZFZM)\n\n  2.4 [Big Omega and Theta](https://www.youtube.com/watch?v=-IanHYk6tU4)\n\n  2.5 [Additional Examples (Review - Optional)](https://www.youtube.com/watch?v=VXQ2p6V5ccQ)\n\n### 3. Divide \u0026 Conquer Algorithms\n\n  3.1 [O(n log n) Algorithm for Counting Inversions I](https://www.youtube.com/watch?v=7_AJfusC6UQ)\n\n  3.2 [O(n log n) Algorithm for Counting Inversions II](https://www.youtube.com/watch?v=I6ygiW8xN7Y)\n\n  3.3 [Strassen's Subcubic Matrix Multiplication Algorithm](https://www.youtube.com/watch?v=ORrM-aSNZUs)\n\n  3.4 [O(n log n) Algorithm for Closest Pair I (Advanced - Optional)](https://www.youtube.com/watch?v=3pUOv_ocJyA)\n\n  3.5 [O(n log n) Algorithm for Closest Pair II (Advanced - Optional)](https://www.youtube.com/watch?v=7tiafUFrlBw)\n\n### Homework 1\n\n* [Problem Set](https://blogs.asarkar.com/algorithms-design-analysis/set-1/)\n* [Optional Theory Problems](homework-1/src/main/scala/org/asarkar/homework/OptionalProblems.scala)\n* [Programming Assignment](homework-1/src/main/scala/org/asarkar/homework/Assignment1.scala)\n\n### 4. The Master Method\n\n  4.1 [Motivation](https://www.youtube.com/watch?v=6dGDcszz2DM)\n\n  4.2 [Formal Statement](https://www.youtube.com/watch?v=rXiojCN9nIs)\n\n  4.3 [Examples](https://www.youtube.com/watch?v=4l1MvY7iGhs)\n\n  4.4 [Proof I](https://www.youtube.com/watch?v=6BVNhKm0vpE)\n\n  4.5 [Interpretation of the 3 Cases](https://www.youtube.com/watch?v=zMYHz5s45T4)\n\n  4.6 [Proof II](https://www.youtube.com/watch?v=cVni6SJrsFw)\n\n### 5. Quicksort - Algorithm\n\n  5.1 [Quicksort: Overview](https://www.youtube.com/watch?v=ETo1cpLN7kk)\n\n  5.2 [Partitioning Around a Pivot](https://www.youtube.com/watch?v=LYzdRN5iFdA)\n\n  5.3 [Correctness of Quicksort (Review - Optional)](https://www.youtube.com/watch?v=Colb_4jAy8A)\n\n  5.4 [Choosing a Good Pivot](https://www.youtube.com/watch?v=kqO46FOUTbI)\n\n### 6. Quicksort - Analysis\n\n  6.1 [Analysis I: A Decomposition Principle (Advanced - Optional)](https://www.youtube.com/watch?v=sToWtKSYlMw)\n\n  6.2 [Analysis II: The Key Insight (Advanced - Optional)](https://www.youtube.com/watch?v=4t_Y-aGLkok)\n\n  6.3 [Analysis III: Final Calculations (Advanced - Optional)](https://www.youtube.com/watch?v=IBTvneWhFsA)\n\n### 7. Probability Review\n\n  7.1 [Probability Review I (Review - Optional)](https://www.youtube.com/watch?v=uLeIMwMHX5U)\n\n  7.2 [Probability Review II (Review - Optional)](https://www.youtube.com/watch?v=lkK8dF0io6Y)\n\n### Homework 2\n\n* [Problem Set](https://blogs.asarkar.com/algorithms-design-analysis/set-2/)\n* [Optional Theory Problems](homework-2/src/main/scala/org/asarkar/homework/OptionalProblems.scala)\n* [Programming Assignment](homework-2/src/main/scala/org/asarkar/homework/Assignment2.scala)\n\n### 8. Linear-time Selection\n\n  8.1 [Randomized Selection - Algorithm](https://www.youtube.com/watch?v=nFw6x7DoYbs)\n\n  8.2 [Randomized Selection - Analysis](https://www.youtube.com/watch?v=rX2u2CnpveQ)\n\n  8.3 [Deterministic Selection - Algorithm (Advanced - Optional)](https://www.youtube.com/watch?v=L5-4cPW5HoU)\n\n  8.4 [Deterministic Selection - Analysis I (Advanced - Optional)](https://www.youtube.com/watch?v=6ntwpZmHN-g)\n\n  8.5 [Deterministic Selection - Analysis II (Advanced - Optional)](https://www.youtube.com/watch?v=hUuTcyQShYo)\n\n  8.6 [Omega(n log n) Lower Bound for Comparison-Based Sorting (Advanced - Optional)](https://www.youtube.com/watch?v=aFveIyII5D4)\n\n### 9. Graphs and the Contraction Algorithm\n\n  9.1 [Graphs and Minimum Cuts](https://www.youtube.com/watch?v=4Ih3UhVuEtw)\n\n  9.2 [Graph Representations](https://www.youtube.com/watch?v=b-Mfu8dPv9U)\n\n  9.3 [Random Contraction Algorithm](https://www.youtube.com/watch?v=c75gg0wicus)\n\n  9.4 [Analysis of Contraction Algorithm](https://www.youtube.com/watch?v=b-_jx2-cK8c)\n\n  9.5 [Counting Minimum Cuts](https://www.youtube.com/watch?v=S9mIhgghfkc)\n\n### Homework 3\n\n* [Problem Set](https://blogs.asarkar.com/algorithms-design-analysis/set-3/)\n* [Optional Theory Problems](https://blogs.asarkar.com/algorithms-design-analysis/hw-3-opt/)\n* [Programming Assignment](homework-3/src/main/scala/org/asarkar/homework/Assignment3.scala)\n\n### 10. Graph Search and Connectivity\n\n  10.1 [Graph Search - Overview](https://www.youtube.com/watch?v=SW6jwg7WS48)\n\n  10.2 [Breadth-First Search (BFS): The Basics](https://www.youtube.com/watch?v=73qCvXsYkfk)\n\n  10.3 [BFS and Shortest Paths](https://www.youtube.com/watch?v=AhEZ4yjkVxA)\n\n  10.4 [BFS and Undirected Connectivity](https://www.youtube.com/watch?v=vHqaiQlOzOw)\n\n  10.5 [Depth-First Search (DFS): The Basics](https://www.youtube.com/watch?v=_9_VUNrWGUs)\n\n  10.6 [Topological Sort](https://www.youtube.com/watch?v=ozso3xxkVGU)\n\n  10.7 [Computing Strong Components: The Algorithm](https://www.youtube.com/watch?v=O98hLTYVN3c)\n\n  10.8 [Computing Strong Components: The Analysis](https://www.youtube.com/watch?v=gbs3UNRJIYk)\n\n  10.9 [Structure of the Web (Optional)](https://www.youtube.com/watch?v=7YodysGShlo)\n\n### Homework 4\n\n* [Problem Set](https://blogs.asarkar.com/algorithms-design-analysis/set-4/)\n* [Optional Theory Problems](https://blogs.asarkar.com/algorithms-design-analysis/hw-4-opt/)\n* [Optional Theory Problems Code](homework-4/src/main/scala/org/asarkar/homework/OptionalProblem.scala)\n* [Programming Assignment](homework-4/src/main/scala/org/asarkar/homework/Assignment4.scala)\n\n### 11. Dijkstra's Shortest-Path Algorithm\n\n  11.1 [Dijkstra's Shortest-Path Algorithm](https://www.youtube.com/watch?v=jRlNVmRjdRk)\n\n  11.2 [Dijkstra's Algorithm: Examples](https://www.youtube.com/watch?v=ahYhIzLklYo)\n\n  11.3 [Correctness of Dijkstra's Algorithm (Advanced - Optional)](https://www.youtube.com/watch?v=sb7j3EW055M)\n\n  11.4 [Dijkstra's Algorithm: Implementation and Running Time](https://www.youtube.com/watch?v=00LtSn_PQjc)\n\n### 12. Heaps\n\n  12.1 [Data Structures: Overview](https://www.youtube.com/watch?v=cMrQxxrKg8I)\n\n  12.2 [Heaps: Operations and Applications](https://www.youtube.com/watch?v=mNYHDv7SbDI)\n\n  12.3 [Heaps: Implementation Details (Advanced - Optional)](https://www.youtube.com/watch?v=6VI5kJu8Mv4)\n\n### 13. Balanced Binary Search Trees\n\n  13.1 [Balanced Search Trees: Operations and Applications](https://www.youtube.com/watch?v=IbNZ-x1I2IM)\n\n  13.2 [Binary Search Tree Basics I](https://www.youtube.com/watch?v=QNSAqmvu4ZQ)\n\n  13.3 [Binary Search Tree Basics II](https://www.youtube.com/watch?v=usq3dxJ2r5k)\n\n  13.4 [Red-Black Trees](https://www.youtube.com/watch?v=O8sPoUZMolU)\n\n  13.5 [Rotations (Advanced - Optional)](https://www.youtube.com/watch?v=CZkBqasoH8c)\n\n  13.6 [Insertion in a Red-Black Tree (Advanced)](https://www.youtube.com/watch?v=c0Y-1UQ3DKg)\n\n### Homework 5\n\n* [Problem Set](https://blogs.asarkar.com/algorithms-design-analysis/set-5/)\n* [Optional Theory Problems](https://blogs.asarkar.com/algorithms-design-analysis/hw-5-opt/)\n* [Programming Assignment](homework-5/src/main/scala/org/asarkar/homework/Assignment5.scala)\n\n### 14. Hashing: The Basics\n\n  14.1 [Hash Tables: Operations and Applications](https://www.youtube.com/watch?v=Qu183GFHbZQ)\n\n  14.2 [Hash Tables: Implementation Details I](https://www.youtube.com/watch?v=j5KkC-wjlK4)\n\n  14.3 [Hash Tables: Implementation Details II](https://www.youtube.com/watch?v=2MocX5A3pSs)\n\n### 15. Universal Hashing\n\n  15.1 [Pathological Data Sets and Universal Hashing Motivation](https://www.youtube.com/watch?v=MWq8BvRR950)\n\n  15.2 [Universal Hashing: Definition and Example (Advanced - Optional)](https://www.youtube.com/watch?v=ggCu8rReKjk)\n\n  15.3 [Universal Hashing: Analysis of Chaining (Advanced - Optional)](https://www.youtube.com/watch?v=pDNQkF0qTms)\n\n  15.4 [Hash Table Performance with Open Addressing (Advanced - Optional)](https://www.youtube.com/watch?v=nWQv4BCEhjM)\n\n### 16. Bloom Filters\n\n  16.1 [Bloom Filters: The Basics](https://www.youtube.com/watch?v=zYlxP7F3Z3c)\n\n  16.2 [Bloom Filters: Heuristic Analysis](https://www.youtube.com/watch?v=oT-Zhry0hBI)\n\n### Homework 6\n\n* [Problem Set](https://blogs.asarkar.com/algorithms-design-analysis/set-6/)\n* [Optional Theory Problems](https://blogs.asarkar.com/algorithms-design-analysis/hw-6-opt/)\n* [Programming Assignment](homework-6/src/main/scala/org/asarkar/homework/)\n\n### Final Exam\n\n* [Final Exam](https://blogs.asarkar.com/algorithms-design-analysis/final/)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasarkar%2Falgorithms-design-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasarkar%2Falgorithms-design-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasarkar%2Falgorithms-design-analysis/lists"}