traitgraph_algo::predefined_graphs

Function create_binary_tree

Source
pub fn create_binary_tree<Graph: DynamicGraph>(
    graph: &mut Graph,
    depth: i32,
) -> Option<Graph::NodeIndex>
where Graph::NodeData: Default, Graph::EdgeData: Default,
Expand description

Adds a binary tree to the given graph. The first added node is the root of the tree. A negative depth adds no nodes to the graph, a depth of 0 just the root, a depth of 1 the root an its children, and so on.