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

Function topologicalSort

javascript/0207-course-schedule.js:168–174  ·  view source on GitHub ↗
(graph, indegree, order = [])

Source from the content-addressed store, hash-verified

166};
167
168var topologicalSort = (graph, indegree, order = []) => {
169 const queue = searchGraph(graph, indegree);
170
171 bfs(graph, indegree, queue, order);
172
173 return order;
174};
175
176var searchGraph = (graph, indegree, queue = new Queue([])) => {
177 for (const node in graph) {

Callers 1

canFinishFunction · 0.70

Calls 2

searchGraphFunction · 0.70
bfsFunction · 0.70

Tested by

no test coverage detected