Skip to content

raultejada24/python-algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š 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.

About

🐍 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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages