From 448a38838771bfde7294a44e9f239c787fb516c5 Mon Sep 17 00:00:00 2001 From: Markus Everling Date: Sun, 28 May 2023 16:12:48 +0000 Subject: [PATCH] Update current impl comment for `select_nth_unstable_by_key` --- library/core/src/slice/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 1f19555522974..62003ddf5153b 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -3113,8 +3113,9 @@ impl [T] { /// /// # Current implementation /// - /// The current algorithm is based on the quickselect portion of the same quicksort algorithm - /// used for [`sort_unstable`]. + /// The current algorithm is an introselect implementation based on Pattern Defeating Quicksort, which is also + /// the basis for [`sort_unstable`]. The fallback algorithm is Median of Medians using Tukey's Ninther for + /// pivot selection, which guarantees linear runtime for all inputs. /// /// [`sort_unstable`]: slice::sort_unstable ///