mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 02:00:00 +03:00
adding algorithm explanation for partition_in_place iter method and bounding complexity to current implementation
This commit is contained in:
@@ -1849,6 +1849,10 @@ fn extend<'a, T, B: Extend<T>>(
|
||||
///
|
||||
/// 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()`].
|
||||
|
||||
Reference in New Issue
Block a user