adding algorithm explanation for partition_in_place iter method and bounding complexity to current implementation

This commit is contained in:
Satyarth Agrahari 2021-05-18 07:59:16 +05:30
parent 196050305c
commit 85e4177184

View file

@ -1849,6 +1849,10 @@ 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()`].