Set of algorithms and data structures which may be useful in programming contests, written in C++.
- Each problem class (graph, number theory, sort etc.) is placed in separate folder.
- Each algorithm is placed in separate header file.
- Each algorithm has exactly one test case, usually loaded from a separate file placed in /tests folder.
- Each non-testing function has possibly most comprehensible variable names, if it's impossible, their usage is commented.
- Graph
- Breadth-First Search
- Depth-First Search
- Euler Path
- Topological Sort using DFS
- Acyclic Test (uses Topological Sort)
- Kosajaru Algorithm for finding Strongly Connected Components
- Prim Algorithm for finding Minimal Spanning Tree
- Dijkstra Algorithm for finding shortest paths from one source in non-negatively weighed graphs.
- Bellman-Ford Algorithm for finding stortest paths from one source in weighed graphs.
- Graph (undirected is represented as directed with double edges - (a, b) and (b, a)
Way too much to write in here...