This repository contains my solutions to the problem sets and programming assignments in Python and Golang for Stanford University's Algorithms Specialization. Also, the repository includes implementations of algorithms discussed during the courses.
The specialization consists of four courses:
- Divide and Conquer, Sorting and Searching, and Randomized Algorithms
- Graph Search, Shortest Paths, and Data Structures
- Greedy Algorithms, Minimum Spanning Trees, and Dynamic Programming
- Shortest Paths Revisited, NP-Complete Problems and What To Do About Them
Module 1:
- Problem Set (Questions)
- Problem Set (Answers)
- Programming Assignment (Task)
- Programming Assignment (Python)
- Programming Assignment (Golang)
- Merge Sort (Python)
- Merge Sort (Golang)
Module 2:
- Problem Set (Questions)
- Problem Set (Answers)
- Programming Assignment (Task)
- Programming Assignment (Python)
- Programming Assignment (Golang)
- Strassen's Sub-cubic Matrix Multiplication Algorithm (Python)
- Strassen's Sub-cubic Matrix Multiplication Algorithm (Golang)
- Algorithm for Closest Pair (Python)
- Algorithm for Closest Pair (Golang)
Module 3:
- Problem Set (Questions)
- Problem Set (Answers)
- Programming Assignment (Task)
- Programming Assignment (Python)
- Programming Assignment (Golang)
- Quick Sort (Python)
- Quick Sort (Golang)
Module 4:
- Problem Set (Questions)
- Problem Set (Answers)
- Programming Assignment (Task)
- Programming Assignment (Python)
- Programming Assignment (Golang)
- Final Exam (Questions)
- Final Exam (Answers)
- Randomized Selection Algorithm (Python)
- Randomized Selection Algorithm (Golang)
- Deterministic Selection Algorithm (Python)
- Deterministic Selection Algorithm (Golang)
- Randomized Contraction Algorithm (Python)
- Randomized Contraction Algorithm (Golang)
Module 1:
- Problem Set (Questions)
- Problem Set (Answers)
- Programming Assignment (Task)
- Programming Assignment (Python)
- Programming Assignment (Golang)
- Breadth-First Search (BFS) (Python)
- Breadth-First Search (BFS) (Golang)
- Depth-First Search (DFS) (Python)
- Depth-First Search (DFS) (Golang)
- Topological Sort (Python)
- Topological Sort (Golang)
Module 2:
- Problem Set (Questions)
- Problem Set (Answers)
- Programming Assignment (Task)
- Programming Assignment (Python)
- Programming Assignment (Golang)
- Dijkstra's Algorithm (Python)
- Dijkstra's Algorithm (Golang)
Module 3:
- Problem Set (Questions)
- Problem Set (Answers)
- Programming Assignment (Task)
- Programming Assignment (Python)
- Programming Assignment (Golang)
- Binary Search Tree (Python)
- Binary Search Tree (Golang)
- Red-Black Tree (Python)
- Red-Black Tree (Golang)
Module 4:
- Problem Set (Questions)
- Problem Set (Answers)
- Programming Assignment (Task)
- Programming Assignment (Python)
- Programming Assignment (Golang)
- Final Exam (Questions)
- Final Exam (Answers)
- Universal Hashing (Python)
- Universal Hashing (Golang)
- Bloom Filters (Python)
- Bloom Filters (Golang)
Module 1:
- Problem Set (Questions)
- Problem Set (Answers)
- Programming Assignment Tasks
- Programming Assignment 1 (Python)
- Programming Assignment 1 (Golang)
- Programming Assignment 2 (Python)
- Programming Assignment 2 (Golang)
- Programming Assignment 3 (Python)
- Programming Assignment 3 (Golang)
- Weighted Job Scheduling Application with Greedy Algorithm (Python)
- Weighted Job Scheduling Application with Greedy Algorithm (Golang)
- Prim's Minimum Spanning Tree (MST) Algorithm (Python)
- Prim's Minimum Spanning Tree (MST) Algorithm (Golang)
Module 2:
- Problem Set (Questions)
- Problem Set (Answers)
- Programming Assignment Tasks
- Programming Assignment 1 (Python)
- Programming Assignment 1 (Golang)
- Programming Assignment 2 (Python)
- Programming Assignment 2 (Golang)
- Kruskal's MST Algorithm (Python)
- Kruskal's MST Algorithm (Golang)
- Clustering Algorithm (Python)
- Clustering Algorithm (Golang)
- Union Find (Python)
- Union Find (Golang)
Module 3:
- Problem Set (Questions)
- Problem Set (Answers)
- Programming Assignment Tasks
- Programming Assignment 1 & 2 (Python)
- Programming Assignment 1 & 2 (Golang)
- Programming Assignment 3 (Python)
- Programming Assignment 3 (Golang)
- Huffman Coding (Python)
- Huffman Coding (Golang)
- Weighted Independent Set (WIS) (Python)
- Weighted Independent Set (WIS) (Golang)
Module 4:
- Problem Set (Questions)
- Problem Set (Answers)
- Programming Assignment Tasks
- Programming Assignment 1 (Python)
- Programming Assignment 1 (Golang)
- Programming Assignment 2 (Python)
- Programming Assignment 2 (Golang)
- Final Exam (Questions)
- Final Exam (Answers)
- Knapsack Problem (Python)
- Knapsack Problem (Golang)
- Optimal Binary Search Tree (Python)
- Optimal Binary Search Tree (Golang)
Module 1:
- Problem Set (Questions & Answers)
- Programming Assignment Task
- Programming Assignment (Python)
- Programming Assignment (Golang)
- The Bellman-Ford Algorithm (Python)
- The Bellman-Ford Algorithm (Golang)
- The Floyd-Warshall Algorithm (Python)
- The Floyd-Warshall Algorithm (Golang)
- Johnson's Algorithm (Python)
- Johnson's Algorithm (Golang)
Module 2:
- Problem Set (Questions)
- Problem Set (Answers)
- Programming Assignment Task
- Programming Assignment (Python)
- Programming Assignment (Golang)
- The Vertex Cover Problem (Python)
- The Vertex Cover Problem (Golang)
- The Traveling Salesman Problem (Python)
- The Traveling Salesman Problem (Golang)
Module 3:
- Problem Set (Questions)
- Problem Set (Answers)
- Programming Assignment Task
- Programming Assignment (Python)
- Programming Assignment (Golang)
- A Greedy Knapsack Heuristic (Python)
- A Greedy Knapsack Heuristic (Golang)
Module 4:
- Problem Set (Questions)
- Problem Set (Answers)
- Programming Assignment Task
- Programming Assignment (Python)
- Programming Assignment (Golang)
- Final Exam (Questions)
- Final Exam (Answers)
- The Maximum Cut Problem (Python)
- The Maximum Cut Problem (Golang)
- The 2-SAT Problem (Python)
- The 2-SAT Problem (Golang)
- Papadimitriou's Algorithm (Python)
- Papadimitriou's Algorithm (Golang)
stanford-university-algorithms-specialization/
├── course_1/
│ ├── module_1/
│ │ ├── problem_set_1/
│ │ │ ├── answers.png
│ │ │ ├── questions.png
│ │ ├── programming_assignment_1/
│ │ │ ├── karatsuba.go
│ │ │ ├── karatsuba.py
│ │ │ ├── task.png
│ │ ├── examples/
│ │ │ ├── mergesort.go
│ │ │ ├── mergesort.py
│ ├── module_2/
│ │ ├── problem_set_2/
│ │ │ ├── answers.png
│ │ │ ├── questions.png
│ │ ├── programming_assignment_2/
│ │ │ ├── IntegerArray.txt
│ │ │ ├── inversion_counter.go
│ │ │ ├── inversion_counter.py
│ │ │ ├── task.png
│ │ ├── examples/
│ │ │ ├── closest_pair.go
│ │ │ ├── closest_pair.py
│ │ │ ├── strassen_matrix_multiplier.go
│ │ │ ├── strassen_matrix_multiplier.py
│ ├── module_3/
│ │ ├── problem_set_3/
│ │ │ ├── answers.png
│ │ │ ├── questions.png
│ │ ├── programming_assignment_3/
│ │ │ ├── QuickSort.txt
│ │ │ ├── solution.go
│ │ │ ├── solution.py
│ │ │ ├── task.png
│ │ ├── examples/
│ │ │ ├── quick_sort.go
│ │ │ ├── quick_sort.py
│ ├── module_4/
│ │ ├── problem_set_4/
│ │ │ ├── answers.png
│ │ │ ├── questions.png
│ │ ├── programming_assignment_4/
│ │ │ ├── kargerMinCut.txt
│ │ │ ├── solution.go
│ │ │ ├── solution.py
│ │ │ ├── task.png
│ │ ├── final_exam/
│ │ │ ├── answers.png
│ │ │ ├── questions.png
│ │ ├── examples/
│ │ │ ├── deterministic_selection.go
│ │ │ ├── deterministic_selection.py
│ │ │ ├── randomized_contraction.go
│ │ │ ├── randomized_contraction.py
│ │ │ ├── randomized_selection.go
│ │ │ ├── randomized_selection.py
├── course_2/
│ ├── module_1/
│ │ ├── problem_set_1/
│ │ │ ├── answers.png
│ │ │ ├── questions.png
│ │ ├── programming_assignment_1/
│ │ │ ├── scc.go
│ │ │ ├── scc.py
│ │ │ ├── SCC.txt
│ │ │ ├── solution.go
│ │ │ ├── solution.py
│ │ │ ├── task.png
│ │ ├── examples/
│ │ │ ├── bfs.go
│ │ │ ├── bfs.py
│ │ │ ├── dfs.go
│ │ │ ├── dfs.py
│ │ │ ├── topological_sort.go
│ │ │ ├── topological_sort.py
│ ├── module_2/
│ │ ├── problem_set_2/
│ │ │ ├── answers.png
│ │ │ ├── questions.png
│ │ ├── programming_assignment_2/
│ │ │ ├── dijkstraData.txt
│ │ │ ├── solution.go
│ │ │ ├── solution.py
│ │ │ ├── task.png
│ │ ├── examples/
│ │ │ ├── dijkstra.go
│ │ │ ├── dijkstra.py
│ ├── module_3/
│ │ ├── problem_set_3/
│ │ │ ├── answers.png
│ │ │ ├── questions.png
│ │ ├── programming_assignment_3/
│ │ │ ├── Median.txt
│ │ │ ├── solution.go
│ │ │ ├── solution.py
│ │ │ ├── task.png
│ │ ├── examples/
│ │ │ ├── binary_search_tree.go
│ │ │ ├── binary_search_tree.py
│ │ │ ├── red_black_tree.go
│ │ │ ├── red_black_tree.py
│ ├── module_4/
│ │ ├── problem_set_4/
│ │ │ ├── answers.png
│ │ │ ├── questions.png
│ │ ├── programming_assignment_4/
│ │ │ ├── 2sum.txt
│ │ │ ├── solution.go
│ │ │ ├── solution.py
│ │ │ ├── task.png
│ │ ├── final_exam/
│ │ │ ├── answers.png
│ │ │ ├── questions.png
│ │ ├── examples/
│ │ │ ├── bloom_filters.go
│ │ │ ├── bloom_filters.py
│ │ │ ├── universal_hashing.go
│ │ │ ├── universal_hashing.py
├── course_3/
│ ├── module_1/
│ │ ├── problem_set_1/
│ │ │ ├── answers.png
│ │ │ ├── questions.png
│ │ ├── programming_assignment_1/
│ │ │ ├── solution_1.go
│ │ │ ├── solution_1.py
│ │ │ ├── solution_2.go
│ │ │ ├── solution_2.py
│ │ │ ├── solution_3.go
│ │ │ ├── solution_3.py
│ │ │ ├── edges.txt
│ │ │ ├── jobs.txt
│ │ │ ├── tasks.png
│ │ ├── examples/
│ │ │ ├── job_scheduler.go
│ │ │ ├── job_scheduler.py
│ │ │ ├── prim_mst.go
│ │ │ ├── prim_mst.py
│ ├── module_2/
│ │ ├── problem_set_2/
│ │ │ ├── answers.png
│ │ │ ├── questions.png
│ │ ├── programming_assignment_2/
│ │ │ ├── clustering1.txt
│ │ │ ├── clustering_big.go
│ │ │ ├── clustering_big.py
│ │ │ ├── clustering_big.txt
│ │ │ ├── solution_1.go
│ │ │ ├── solution_1.py
│ │ │ ├── solution_2.go
│ │ │ ├── solution_1.py
│ │ │ ├── tasks.png
│ │ ├── examples/
│ │ │ ├── clustering.go
│ │ │ ├── clustering.py
│ │ │ ├── kruskal_mst.go
│ │ │ ├── kruskal_mst.py
│ │ │ ├── union_find.py
│ │ │ ├── union_find.py
│ ├── module_3/
│ │ ├── problem_set_3/
│ │ │ ├── answers.png
│ │ │ ├── questions.png
│ │ ├── programming_assignment_3/
│ │ │ ├── huffman.txt
│ │ │ ├── mwis.txt
│ │ │ ├── solution_1&2.go
│ │ │ ├── solution_1&2.py
│ │ │ ├── solution_3.go
│ │ │ ├── solution_3.py
│ │ │ ├── tasks.png
│ │ ├── examples/
│ │ │ ├── huffman.go
│ │ │ ├── huffman.py
│ │ │ ├── wis.go
│ │ │ ├── wis.py
│ ├── module_4/
│ │ ├── problem_set_4/
│ │ │ ├── answers.png
│ │ │ ├── questions.png
│ │ ├── programming_assignment_4/
│ │ │ ├── knapsack1.txt
│ │ │ ├── knapsack_big.txt
│ │ │ ├── solution_1.go
│ │ │ ├── solution_1.py
│ │ │ ├── solution_2.go
│ │ │ ├── solution_2.py
│ │ │ ├── tasks.png
│ │ ├── final_exam/
│ │ │ ├── answers.png
│ │ │ ├── questions.png
│ │ ├── examples/
│ │ │ ├── knapsack.go
│ │ │ ├── knapsack.py
│ │ │ ├── optimal_binary_search_tree.go
│ │ │ ├── optimal_binary_search_tree.py
├── course_4/
│ ├── module_1/
│ │ ├── problem_set_1/
│ │ │ ├── questions_answers.png
│ │ ├── programming_assignment_1/
│ │ │ ├── g1.txt
│ │ │ ├── g2.txt
│ │ │ ├── g3.txt
│ │ │ ├── large.txt
│ │ │ ├── solution.go
│ │ │ ├── solution.py
│ │ │ ├── task.png
│ │ ├── examples/
│ │ │ ├── bellman_ford.go
│ │ │ ├── bellman_ford.py
│ │ │ ├── floyd_warshall.go
│ │ │ ├── floyd_warshall.py
│ │ │ ├── johnson.go
│ │ │ ├── johnson.py
│ ├── module_2/
│ │ ├── problem_set_2/
│ │ │ ├── questions.png
│ │ │ ├── answers.png
│ │ ├── programming_assignment_2/
│ │ │ ├── solution.go
│ │ │ ├── solution.py
│ │ │ ├── task.png
│ │ │ ├── tsp.txt
│ │ ├── examples/
│ │ │ ├── traveling_salesman.go
│ │ │ ├── traveling_salesman.py
│ │ │ ├── vertex_cover.go
│ │ │ ├── vertex_cover.py
│ ├── module_3/
│ │ ├── problem_set_3/
│ │ │ ├── questions.png
│ │ │ ├── answers.png
│ │ ├── programming_assignment_3/
│ │ │ ├── nn.txt
│ │ │ ├── solution.go
│ │ │ ├── solution.py
│ │ │ ├── task.png
│ │ ├── examples/
│ │ │ ├── greedy_knapsack_heuristic.go
│ │ │ ├── greedy_knapsack_heuristic.py
│ ├── module_4/
│ │ ├── problem_set_4/
│ │ │ ├── answers.png
│ │ │ ├── questions.png
│ │ ├── programming_assignment_4/
│ │ │ ├── 2sat1.txt
│ │ │ ├── 2sat2.txt
│ │ │ ├── 2sat3.txt
│ │ │ ├── 2sat4.txt
│ │ │ ├── 2sat5.txt
│ │ │ ├── 2sat6.txt
│ │ │ ├── solution.go
│ │ │ ├── solution.py
│ │ │ ├── task.png
│ │ ├── final_exam/
│ │ │ ├── answers.png
│ │ │ ├── questions.png
│ │ ├── examples/
│ │ │ ├── maximum_cut.go
│ │ │ ├── maximum_cut.py
│ │ │ ├── papadimitriou.go
│ │ │ ├── papadimitriou.py
│ │ │ ├── two_sat.go
│ │ │ ├── two_sat.py
├── LICENSE
└── README.md
This project is licensed under the MIT License.
Feel free to use, modify, and distribute the code as described in the license.