Settings

Theme

Binary Search in Rust

docs.rs

2 points by SagelyGuru 3 years ago · 1 comment

Reader

SagelyGuruOP 3 years ago

A note from the author: go to line 126

Finds all items partially equal (not necessarily literally equal) to val. In a generic slice in ascending or descending order. Returns the Range of the matching items. When the range is empty (n..n), then n is the sort order of where the missing val could be inserted.

Assigns a comparator closure `pcomp` just once, depending on whether the order is ascending or descending.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection