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

Function isCyclic

javascript/0207-course-schedule.js:41–49  ·  view source on GitHub ↗
(currCourse, graph, path)

Source from the content-addressed store, hash-verified

39};
40
41var isCyclic = (currCourse, graph, path) => {
42 const hasSeen = path[currCourse];
43 if (hasSeen) return true;
44
45 const isMissingNext = !(currCourse in graph);
46 if (isMissingNext) return false;
47
48 return backTrack(currCourse, graph, path);
49};
50
51var backTrack = (currCourse, graph, path) => {
52 path[currCourse] = true;

Callers 3

hasPathFunction · 0.85
hasCycleFunction · 0.85
canFinishFunction · 0.85

Calls 1

backTrackFunction · 0.70

Tested by

no test coverage detected