Function heap::replace_root
[−]
[src]
pub fn replace_root<A, F: Fn(&A, &A) -> bool>(
arity: usize,
f: F,
xs: &mut [A],
x: A
) -> A
Given a slice xs
which is already a heap, replace the root.
f(x,y)
is whether x
must be nearer to the root than y
.
xs
being empty is an error.