Advanced-graphs

20 articles

dsa8 min read

Kruskal Minimum Spanning Tree — Greedy Edge Selection with Union-Find

LC 1584 Minimum Cost to Connect All Points and LC 1135 Connecting Cities are MST problems straight from the FAANG playbook. Master Kruskal: sort edges by weight, accept the cheapest edge that does not form a cycle using Union-Find, and prove correctness via the cut property in one sentence.

Read →
dsa9 min read

A* Search — Heuristic Shortest Path for Grids and Maps [LC 1091, Google, Tesla]

Master A* search: a heuristic-guided best-first search that finds optimal shortest paths far faster than Dijkstra by combining actual distance g(n) with an admissible estimate h(n). The interview pattern behind LeetCode 1091 Shortest Path in Binary Matrix and the algorithm powering Google Maps, game AI, and robotics navigation.

Read →