https://github.com/patnaikankit/graph-and-trees
Templates for the most important algorithms used in graph and trees.
https://github.com/patnaikankit/graph-and-trees
Last synced: 4 months ago
JSON representation
Templates for the most important algorithms used in graph and trees.
- Host: GitHub
- URL: https://github.com/patnaikankit/graph-and-trees
- Owner: patnaikankit
- Created: 2023-06-19T16:39:16.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-28T05:21:44.000Z (about 1 year ago)
- Last Synced: 2025-01-29T03:49:29.929Z (5 months ago)
- Language: C++
- Homepage:
- Size: 151 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
Graph:
* If you don't care about length of the path - DFS
* If you want to travel limited/ Shortest path - BFS
* DAG - Topo sort (sometimes with dp)
* Weighted directed/undirected shortest path - Dijkstra
* (-ve) wt - Bellman ford
* All pairs of shortest path - Floyd Warshall
* If you want to find if two node belong to the same component in constant time - DSU