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 without dependencies first, then the ones that depend on them, like stacking books in order.
Graph: A -> B -> C ā ā D --------- Start DFS at nodes with no incoming edges. Stack stores tasks after visiting dependents. Final order is stack reversed.
