MCPcopy Index your code
hub / github.com/TheAlgorithms/Rust / directed_graph_detect_cycle_dfs

Function directed_graph_detect_cycle_dfs

src/graph/detect_cycle.rs:87–107  ·  view source on GitHub ↗

Helper function to detect cycle in a directed graph using DFS graph traversal

(
    graph: &'a DirectedGraph,
    visited_node: &mut HashSet<&'a String>,
    in_stack_visited_node: &mut HashSet<&'a String>,
    u: &'a String,
)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

detect_cycle_dfsMethod · 0.85

Calls 5

adjacency_tableMethod · 0.80
insertMethod · 0.45
getMethod · 0.45
containsMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected