MCPcopy Create free account
hub / github.com/TheAlgorithms/Rust / undirected_graph_detect_cycle_dfs

Function undirected_graph_detect_cycle_dfs

src/graph/detect_cycle.rs:11–29  ·  view source on GitHub ↗

Helper function to detect cycle in an undirected graph using DFS graph traversal

(
    graph: &'a UndirectedGraph,
    visited_node: &mut HashSet<&'a String>,
    parent: Option<&'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 4

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

Tested by

no test coverage detected