Alien Dictionary: Topological Sort from Word Ordering
Derive character ordering from sorted alien words using topological sort, with course schedule variants and prerequisite chain problems.
35 posts · page 1 of 1
Derive character ordering from sorted alien words using topological sort, with course schedule variants and prerequisite chain problems.
Learn how to check if a graph is bipartite using BFS 2-coloring and DFS, with applications in matching, scheduling, and conflict detection.
Learn to clone graphs with BFS and DFS, validate graph trees, find minimum height trees via centroid decomposition, and reconstruct itineraries with Hierholzer's algorithm.
Master finding connected components using DFS, BFS, and Union-Find with applications to counting islands and grid connectivity problems.
Learn how to detect negative cycles using Bellman-Ford's nth relaxation, SPFA algorithm, and apply it to arbitrage detection in currency exchange graphs.
Master flood fill, surrounded regions, number of enclaves, and Pacific Atlantic water flow using DFS and BFS grid traversal techniques in Python.
Master the top 20 graph interview patterns with a BFS vs DFS decision flowchart, Union-Find strategies, grid vs adjacency list trade-offs, and template code.
Explore MST applications in network design, clustering, and competitive programming with second-best MST, critical edges, and minimum cost to connect points.
Master shortest path algorithms on grids including BFS for unweighted grids, 0-1 BFS with deque, and Dijkstra for weighted terrain with obstacles and portals.
Solve word search with DFS backtracking, Boggle with Trie pruning, and word ladder with BFS for efficient string transformation problems.
Learn the A* search algorithm with f=g+h, admissible heuristics, grid pathfinding, and Python implementation compared to Dijkstra and BFS.
Find critical nodes and edges in graphs using Tarjan's algorithm with discovery and low-link arrays, with Python code and network applications.
Understand Euler paths, circuits, and Hamiltonian differences with Hierholzer's algorithm, degree conditions, and Python implementations.
Learn graph coloring with greedy coloring, bipartite check via 2-coloring, m-coloring with backtracking, and applications in scheduling.
Solve grid-based graph problems including flood fill, number of islands, shortest path in binary matrix, and surrounded regions with Python.
Learn how to detect cycles in directed and undirected graphs using DFS with parent tracking, three-color DFS, and Union-Find with Python implementations.
Understand max flow, residual graphs, augmenting paths, Ford-Fulkerson, Edmonds-Karp, and the max-flow min-cut theorem with Python code.
Master multi-source BFS for rotting oranges, walls and gates, 01-BFS, and matrix distance problems with Python implementations.
Compare all four shortest path algorithms with Python code, complexity analysis, and a decision flowchart for choosing the right one.
Master SCCs with Kosaraju's two-pass DFS and Tarjan's low-link algorithm, including condensation graphs and real applications in Python.
Master topological sorting with Kahn's BFS and DFS approaches. Solve course scheduling, build dependencies, alien dictionary, and longest path in DAG problems.
Deep dive into advanced graph algorithms — Tarjan's and Kosaraju's for SCCs, bridges and articulation points, Euler paths, network flow, and 2-SAT with real-world applications.
Master the Floyd-Warshall algorithm — understand the DP recurrence, implement it in Python, detect negative cycles, and know when to pick it over Dijkstra.
Learn graph coloring fundamentals — check if a graph is bipartite using BFS/DFS, solve m-coloring with backtracking, and tackle classic interview problems.
Master graph traversal patterns for LeetCode including BFS, DFS, topological sort, Dijkstra, and practical templates with solutions.
Understand Bellman-Ford's relaxation loop, how it handles negative edges, detects negative cycles, and why it costs more than Dijkstra.
Learn Dijkstra's shortest path algorithm with a clean Python implementation, complexity analysis, and the priority queue intuition behind it.
Build minimum spanning trees with Kruskal's union-find approach and Prim's priority queue approach, with side-by-side Python implementations.
Why a hash map from original to copy is the entire idea, plus the BFS variant for stack-limited environments.
Detect cycles and produce a valid course order using DFS-based topological sort. Includes BFS Kahn alternative and interview script.
Why reverse traversal beats per-cell flood fill, and how the intersection of two reach sets gives the answer.
The wildcard-pattern adjacency trick, why BFS is mandatory, and the bidirectional speedup.
Compare Kahn's BFS-based topological sort with DFS-based postorder, with Python implementations, complexity, and cycle detection.
A practical guide to BFS and DFS on graphs — recursive and iterative DFS, BFS with a deque, shortest paths on unweighted graphs, connected components, cycle detection, and five classic practice problems.
A practical introduction to graphs — directed vs undirected, weighted vs unweighted, cyclic vs acyclic, and the three main representations (adjacency list, adjacency matrix, edge list) with Python code.