python-algorithms project is a collection of algorithms and datastructures implemented on
Python3.6
You don’t need to install these project as a module (via
pip) because usually you just need only one algorithm instead of all
pack, so just copy and paste the source code. For easy navigation please
use links to the source code below.
- Binary search
- Closest pair
- Fibonacci [Recursive method]
- Fibonacci by Modulo [with Pisano period]
- Rabin-Karp algorithm
- DFS (Depth first search)
- BFS (Breadth first search)
- Dijkstra (priority queue)
- Bidirectional Dijkstra (priority queues)
- Cycle detection (DFS)
- SCC (Strongly connected components)
- Topological Sort
- Bipartite
- Bellman-Ford algorithm (negative cycle detection)
- Bellman-Ford algorithm (and negative cycle detection based on this approach + infinity Arbitrage detection)
- Kruskal algorithm for connecting points
- AStar (potential function - euclidean distance)
- BST checker
- Tree traversal methods (in/pre/post order recursive and iterative)
- Rope data structure (heavyweight strings based on splay tree with iterative in order traversal)