(currCourse, graph, path)
| 49 | }; |
| 50 | |
| 51 | var backTrack = (currCourse, graph, path) => { |
| 52 | path[currCourse] = true; |
| 53 | const _hasCycle = hasCycle(currCourse, graph, path); |
| 54 | path[currCourse] = false; |
| 55 | |
| 56 | return _hasCycle; |
| 57 | }; |
| 58 | |
| 59 | var hasCycle = (currCourse, graph, path) => { |
| 60 | for (const neighbor of graph[currCourse]) { |