Skip to main content

is_path

Function is_path 

Source
pub fn is_path(graph: &Graph) -> bool
Expand description

Returns whether graph is a path: a tree in which every node has out-degree at most 1.

The empty graph is a path.

Time: O(node_count + edge_count). Memory: 8 x node_count bytes while it runs.