From 85e417718403cc0a8b058585fb8633b4698ea3e2 Mon Sep 17 00:00:00 2001 From: Satyarth Agrahari Date: Tue, 18 May 2021 07:59:16 +0530 Subject: [PATCH] adding algorithm explanation for partition_in_place iter method and bounding complexity to current implementation --- library/core/src/iter/traits/iterator.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/core/src/iter/traits/iterator.rs b/library/core/src/iter/traits/iterator.rs index 43d60a4ed76c..7ba2dfc99418 100644 --- a/library/core/src/iter/traits/iterator.rs +++ b/library/core/src/iter/traits/iterator.rs @@ -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()`].