Neural Ninjas · DSA Simulation Labs · Lab 47

0️⃣ Kahn's In-Degree Queue

Every node carries a counter of how many arrows point INTO it. Only a node reading exactly zero is allowed into the queue. Process it, knock one off every node it points to, and repeat — anyone left with a nonzero counter at the end means a cycle.

Queue Log

Controls

🔢 In-Degree CounterI only count arrows pointing AT me, never away from me. The moment I hit zero, every prerequisite of mine is already done — I'm free.
📋 The QueueI only ever accept nodes reading exactly zero. When I process one, I knock its counter's contribution off of everyone it points to.
Pick a level above to begin.