Mental Model
We visit each task and all tasks that depend on it first, then add the task to the order. This way, dependencies come before the tasks that need them.
Analogy: Imagine you have to finish homework problems, but some problems need answers from others first. You solve the ones with no dependencies first, then move on to the ones that depend on them.
Graph: A -> B -> C ā D We want an order like D -> A -> B -> C where each arrow means 'must come before'.
