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

Function find_max

src/tree/binary/bst.rs:132–141  ·  view source on GitHub ↗

# Safety This is highly unsafe, due to pointer

(node: Option<NonNull<Node<K, V>>>)

Source from the content-addressed store, hash-verified

130///
131/// This is highly unsafe, due to pointer
132pub unsafe fn find_max<K, V>(node: Option<NonNull<Node<K, V>>>) -> Option<NonNull<Node<K, V>>>
133where
134 K: Ord,
135{
136 node.and_then(|node| {
137 node.as_ref()
138 .right
139 .map_or(Some(node), |r| find_max(Some(r)))
140 })
141}
142
143/// # Safety
144///

Callers 3

maxMethod · 0.85
predFunction · 0.85
maxMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected