Cheat sheets

ALG-18Cheat sheet1 pageIn a paid pack

BFS, DFS and Edge Classification

Breadth-first and depth-first search with their data structures, the order rule for neighbours, costs on adjacency lists and matrices, BFS levels and fewest-edge paths traced on six vertices, the level rule for non-tree edges; DFS discovery and finish times, the parenthesis and white-path theorems, classification of tree, back, forward and cross edges by colour and by time intervals, drawn on one DFS forest; what changes for undirected graphs; counting components from a DFS forest with the solved GATE CS 2024 Set 1 Q.60.

Diagrams from ALG-18

ALG-19Cheat sheet1 pageIn a paid pack

Topological Sort, Components, Bipartite

Topological sort by decreasing DFS finish time and by Kahn's in-degree method, traced on one DAG; counting topological orders and the exact condition for a unique order; cycle detection in directed and undirected graphs; connected components; strongly connected components with Kosaraju's two passes and Tarjan's one-pass method, traced on eight vertices, and the condensation DAG; bipartite testing by BFS two-colouring; articulation points and bridges from DFS low values with a traced example checked by brute force.