Tag: Graph
3 posts
-
Graph Representation: Adjacency List vs Matrix, Building Graphs from Input, and Cycle Detection
Graph representation for interviews: adjacency list vs matrix memory, grids and edge lists, index bugs in graph building, cycle detection, topological sort.
-
BFS vs DFS: Choosing a Graph Traversal for Shortest Paths, Components and Cycles
BFS and DFS in Python for interviews: why BFS finds shortest paths, when to mark nodes visited, recursion limits, iterative DFS order bugs and grid patterns.
-
BFS vs DFS: How Each Works, Complexity and Which to Use for Which Problem
Compare BFS and DFS from the perspective of working principles, time complexity, and space complexity.