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

Function searchGraph

javascript/0210-course-schedule-ii.js:148–154  ·  view source on GitHub ↗
(graph, indegree, queue = new Queue([]))

Source from the content-addressed store, hash-verified

146var isSource = (count) => count === 0;
147
148var searchGraph = (graph, indegree, queue = new Queue([])) => {
149 for (const node in graph) {
150 if (isSource(indegree[node])) queue.enqueue(node);
151 }
152
153 return queue;
154};
155
156var bfs = (graph, indegree, queue, reversedOrder = []) => {
157 while (!queue.isEmpty()) {

Callers 1

topologicalSortFunction · 0.70

Calls 1

isSourceFunction · 0.85

Tested by

no test coverage detected