pub fn tree_depth(arena: &TreeArena, root: NodeId) -> u16Available 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).