MCPcopy Create free account
hub / github.com/douchuan/algorithm / dfs

Function dfs

tests/test_undirected_graph.rs:52–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50
51#[test]
52fn dfs() {
53 let graph = create_graph(TINY_G);
54 let dfs = DepthFirstSearch::new(graph.as_ref(), 0);
55 assert_ne!(dfs.count(), graph.V());
56 assert!(vec![1, 2, 3, 4, 5, 6].iter().all(|&w| dfs.marked(w)));
57 assert!(vec![7, 8, 9, 10, 11, 12].iter().all(|&w| !dfs.marked(w)));
58}
59
60#[test]
61fn non_recursive_dfs() {

Callers

nothing calls this directly

Calls 1

create_graphFunction · 0.70

Tested by

no test coverage detected