DSA · interactive
Topological sort: an order that respects dependencies
Courses with prerequisites, build steps, package installs: what can you do first? Count each item's unmet prerequisites, start with the ones at zero, and unlock the rest as you go.
Ready queue: Intro
Order: —
Count prerequisites for each course. Courses with 0 can start: Intro.
Prerequisites
1 For each node, count how many prerequisites point at it. That's the small number on each box.
indegree[v]++ for each edge u → v
2 3 4
Now solve it
Advanced Graphs: 5 problems
See all →In production
Tools and technologies
Every build and package tool sorts dependencies.
Not tied to one language — use these names when you search docs or design a system.