Opening your learning path
Progress is saved as you study.
Opening your learning path
Progress is saved as you study.
The Graph Traversal Patterns (DFS & BFS) pattern applies when you need dFS/BFS traversal, topological sort, shortest paths, Union-Find, and MST. Its time complexity is O(V + E) and space complexity O(V). It is used in 60 problems on Thita, including Accounts Merge, Alien Dictionary and All Paths from Source Lead to Destination. Common variations are Graph DFS - Cycle Detection (Directed Graph) and Deep Copy / Cloning.
Master graph algorithms including DFS/BFS traversal, topological sort, shortest paths (Dijkstra, Bellman-Ford), Union-Find, and advanced graph concepts.
Graph Traversal Patterns (DFS & BFS) is pattern 13 of 16 in the Thita.ai DSA course. It covers dFS/BFS traversal, topological sort, shortest paths, Union-Find, and MST, split into 12 subpatterns and about 5 hours of study. It is one of the interview-critical patterns, so it is worth covering before your first onsite.
Each subpattern below has its own theory page and problem set. They are listed in the order the course teaches them.
Read the theory for a subpattern, then solve its problems in the browser editor. Your solution runs against the problem's test cases, and the AI coach gives a hint on the technique you are missing rather than the finished answer. Progress is tracked per subpattern, so the tracker shows which of the 12 Graph Traversal Patterns (DFS & BFS) subpatterns you have covered. Topics covered here include graph traversal, graph DFS, graph BFS, topological sort, shortest path, Dijkstra algorithm, Union-Find, connected components.