Skip to main content

tree_depth

Function tree_depth 

Source
pub fn tree_depth(arena: &TreeArena, root: NodeId) -> u16
Available on crate feature alloc only.
Expand description

Compute the maximum depth of any leaf reachable from root.

Returns 0 for a single-leaf tree (root is a leaf at depth 0). Returns 0 if the tree is empty (no leaves found).