Expand description
Ordering algorithms.
Structs§
- Piecewise
Linear Convex Fn - Represents a maximum (upper envelope) of a collection of linear functions of one variable, evaluated using an online version of the convex hull trick. It combines the offline algorithm with square root decomposition, resulting in an asymptotically suboptimal but simple algorithm with good amortized performance: N inserts interleaved with Q queries yields O(N sqrt Q + Q log N) time complexity in general, or O((N + Q) log N) if all queries come after all inserts.
- Sparse
Index - A simple data structure for coordinate compression
Functions§
- asserting_
cmp - A comparator on partially ordered elements, that panics if they are incomparable
- merge_
sort - A stable sort
- merge_
sorted - Stably merges two sorted and totally ordered collections into one
- slice_
lower_ bound - Assuming slice is sorted and totally ordered, returns the minimum i for which slice[i] >= key, or slice.len() if no such i exists
- slice_
upper_ bound - Assuming slice is sorted and totally ordered, returns the minimum i for which slice[i] > key, or slice.len() if no such i exists