Concepts4
⚙️AlgorithmIntermediate
Topological Sort - DP on DAG
Topological sort orders vertices of a directed acyclic graph (DAG) so every edge goes from earlier to later, which is perfect for dynamic programming (DP).
#topological sort#dag dp#longest path dag+12
⚙️AlgorithmIntermediate
DFS - Tree and Graph Properties
Depth-First Search (DFS) assigns each vertex a discovery time and a finish time that capture a neat nesting structure of recursion.
#dfs#timestamps#discovery time+11
⚙️AlgorithmIntermediate
Topological Sort
Topological sort orders the nodes of a directed acyclic graph (DAG) so every edge points from left to right in the order.
#topological sort#kahn algorithm#dfs topological order+12
⚙️AlgorithmIntermediate
Depth-First Search (DFS)
Depth-First Search (DFS) explores a graph by going as deep as possible along each path before backtracking.
#depth-first search#dfs#graph traversal+12