(node, graph, color, topologicalOrder, isDirectedAcyclicGraph)
| 50 | }; |
| 51 | |
| 52 | var dfs = (node, graph, color, topologicalOrder, isDirectedAcyclicGraph) => { |
| 53 | const hasCycle = !isDirectedAcyclicGraph[0]; |
| 54 | if (hasCycle) return; |
| 55 | |
| 56 | colorBackTrack( |
| 57 | node, |
| 58 | graph, |
| 59 | color, |
| 60 | topologicalOrder, |
| 61 | isDirectedAcyclicGraph, |
| 62 | ); |
| 63 | |
| 64 | topologicalOrder.push(node); |
| 65 | }; |
| 66 | |
| 67 | const colorBackTrack = ( |
| 68 | node, |
no test coverage detected