

Github Tracking Issue for VecDeque binary search functions · Issue #78021 · rust...
source link: https://github.com/rust-lang/rust/issues/78021
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Feature gate: #![feature(vecdeque_binary_search)]
This is a tracking issue for VecDeque::binary_search{,_by,_by_key}()
, formerly RFC rust-lang/rfcs#2997
Public API
// alloc::collections::vec_deque impl<T> VecDeque<T> { pub fn binary_search(&self, x: &T) -> Result<usize, usize> where T: Ord; pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize> where F: FnMut(&'a T) -> Ordering; pub fn binary_search_by_key<'a, B, F>(&'a self, b: &B, f: F) -> Result<usize, usize> where F: FnMut(&'a T) -> B, B: Ord; pub fn partition_point<P>(&self, mut pred: P) -> usize where P: FnMut(&T) -> bool; }
Steps / History
Unresolved Questions
-
Stop at
Equal
like we do for[]
? #78021 (comment) -
Add
partition_point
too, just like[]
has?
Recommend
-
8
On induction and recursive functions, with an application to binary search yourbasic.org To make sense of recursive functions, you can use a way of thinking closely related to mathematical induction.
-
20
Member dtolnay commented
-
6
New issue Avoid hash_slice in VecDeque's Hash implementation #81170
-
14
Collaborator rust-log-analyzer commented
-
12
Copy link Member cuviper commented...
-
14
Copy link Contributor SOF3 commented
-
10
Copy link Contributor Xuanwo commented...
-
4
Copy link Contributor hkratz commented
-
6
Issue with Problem 170 (Binary Search in Array) Back to General discussions forum
-
7
Copy link Contributor bstrie ...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK