DFS, BFS
O(V+E)
PRE
ROOT, LEFT, RIGHT
IN
LEFT, ROOT, RIGHT
POST
LEFT, RIGHT, ROOT
DFS and BFS always runs O(v^2) on
Complete Graph
Check Tree or Not
Topological order
Colors
Blue - visited,
Orange - back tracked or end
If black edge and next node is visited then cycle
First all edges are black, mark as orange after traversal
order
BFS - level order
DFS - pre order traversal
Visit and explore
visit the node and explore of each child node
DFS and BFS can run in O(V^2)
DAG, Bipartite Graph, Complete Graph
Topological
Graph should be DAG
https://www.youtube.com/watch?v=cIBFEhD77b4
https://www.youtube.com/watch?v=dis_c84ejhQ
A graph can have many topological sort orders
yes