Skip to content

Latest commit

 

History

History
73 lines (56 loc) · 2.04 KB

File metadata and controls

73 lines (56 loc) · 2.04 KB

📚 Advanced Algorithms: Greedy, Graphs, Divide & Conquer, Backtracking, and more

🐍 This repository contains the implementation and resolution of fundamental computer science algorithms, categorized by algorithmic paradigms. Each section includes 6 solved exercises, accompanied by explanatory comments and, in some cases, visualizations or efficiency comparisons.

📁 Repository Structure

advanced-algorithms/
│
├── 01-greedy/
│   ├── exercise1.py
│   ├── ...
│   └── exercise6.py
│
├── 02-graphs/
│   ├── exercise1.py
│   ├── ...
│   └── exercise6.py
│
├── 03-divide-and-conquer/
│   ├── exercise1.py
│   ├── ...
│   └── exercise6.py
│
├── 04-backtracking-pruning/
│   ├── exercise1.py
│   ├── ...
│   └── exercise6.py
│
├── 05-greedy-on-graphs/
│   ├── exercise1.py
│   ├── ...
│   └── exercise6.py
│
└── README.md

🧠 Content by Section

1. Greedy Algorithms

Implementations of algorithms such as the coin change problem, fractional knapsack, activity selection, etc.

2. Graphs

BFS, DFS, cycle detection, Topological Sort (TopSort), connected components, shortest paths, etc.

3. Divide and Conquer

Includes MergeSort, QuickSort, Binary Search, finding maximum/minimum values, matrix multiplication, etc.

4. Backtracking with Pruning

Sudoku solvers, N-Queens problem, labyrinths, exact knapsack, and combinations with constraints.

5. Greedy Algorithms on Graphs

Prim's and Kruskal's algorithms (MST), Dijkstra's algorithm (shortest path), edge selection, and spanning trees.

⚙️ Requirements

  • Python 3.9+
  • Libraries: networkx, matplotlib (optional, for graph visualization)

🚀 How to Run

cd 01-greedy
python exercise1.py

🤝 Contributing

If you'd like to add more exercises or improvements, feel free to fork the repository and open a Pull Request.

📜 License

This project is licensed under the MIT License.