mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
Rollup merge of #85315 - satylogin:master, r=yaahc
adding time complexity for partition_in_place iter method I feel that one thing missing from rust docs compared to cpp references is existence of time complexity for all methods and functions. While it would be humongous task to include it for everything in single go, it is still doable if we as community keep on adding it in relevant places as and when we find them. This PR adds the time complexity for partition_in_place method in iter.
This commit is contained in:
commit
c1c4cd57b3
@ -1849,6 +1849,12 @@ pub trait Iterator {
|
||||
///
|
||||
/// The relative order of partitioned items is not maintained.
|
||||
///
|
||||
/// # Current implementation
|
||||
/// Current algorithms tries finding the first element for which the predicate evaluates
|
||||
/// to false, and the last element for which it evaluates to true and repeatedly swaps them.
|
||||
///
|
||||
/// Time Complexity: *O*(*N*)
|
||||
///
|
||||
/// See also [`is_partitioned()`] and [`partition()`].
|
||||
///
|
||||
/// [`is_partitioned()`]: Iterator::is_partitioned
|
||||
|
Loading…
Reference in New Issue
Block a user