MCPcopy Index your code
hub / github.com/neetcode-gh/leetcode / searchGraph

Function searchGraph

javascript/0207-course-schedule.js:176–183  ·  view source on GitHub ↗
(graph, indegree, queue = new Queue([]))

Source from the content-addressed store, hash-verified

174};
175
176var searchGraph = (graph, indegree, queue = new Queue([])) => {
177 for (const node in graph) {
178 const isSource = indegree[node] === 0;
179 if (isSource) queue.enqueue(node);
180 }
181
182 return queue;
183};
184
185var bfs = (graph, indegree, queue, order) => {
186 while (!queue.isEmpty()) {

Callers 1

topologicalSortFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected