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

Method children_count

src/tree/binary/node.rs:70–72  ·  view source on GitHub ↗

直接子节点个数,不包括孙子...

(node: NonNull<Self>)

Source from the content-addressed store, hash-verified

68
69 /// 直接子节点个数,不包括孙子...
70 pub fn children_count(node: NonNull<Self>) -> usize {
71 unsafe { node.as_ref().left.map_or(0, |_| 1) + node.as_ref().right.map_or(0, |_| 1) }
72 }
73}
74
75// relation

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected