Closed lrvideckis closed 1 month ago
https://doc.rust-lang.org/std/primitive.slice.html#method.partition_point
for the predicate you pass in: for some prefix of the array, the predicate is true, then for the remaining suffix, the predicate is false
Let's match this: for the path from u to LCA, the variable which side should be true, then for the path from v to LCA, it should be false
which side
c++ has same interface https://en.cppreference.com/w/cpp/algorithm/partition
https://doc.rust-lang.org/std/primitive.slice.html#method.partition_point
for the predicate you pass in: for some prefix of the array, the predicate is true, then for the remaining suffix, the predicate is false
Let's match this: for the path from u to LCA, the variable
which side
should be true, then for the path from v to LCA, it should be false