Skip to content

Commit ea32791

Browse files
committed
Update current implementation comments for select_nth_unstable
1 parent 0004b3b commit ea32791

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

library/core/src/slice/mod.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -3005,8 +3005,9 @@ impl<T> [T] {
30053005
///
30063006
/// # Current implementation
30073007
///
3008-
/// The current algorithm is based on the quickselect portion of the same quicksort algorithm
3009-
/// used for [`sort_unstable`].
3008+
/// The current algorithm is an introselect implementation based on Pattern Defeating Quicksort, which is also
3009+
/// the basis for [`sort_unstable`]. The fallback algorithm is Median of Medians using Tukey's Ninther for
3010+
/// pivot selection, which guarantees linear runtime for all inputs.
30103011
///
30113012
/// [`sort_unstable`]: slice::sort_unstable
30123013
///
@@ -3056,8 +3057,9 @@ impl<T> [T] {
30563057
///
30573058
/// # Current implementation
30583059
///
3059-
/// The current algorithm is based on the quickselect portion of the same quicksort algorithm
3060-
/// used for [`sort_unstable`].
3060+
/// The current algorithm is an introselect implementation based on Pattern Defeating Quicksort, which is also
3061+
/// the basis for [`sort_unstable`]. The fallback algorithm is Median of Medians using Tukey's Ninther for
3062+
/// pivot selection, which guarantees linear runtime for all inputs.
30613063
///
30623064
/// [`sort_unstable`]: slice::sort_unstable
30633065
///

0 commit comments

Comments
 (0)