mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 18:27:37 +00:00
Rollup merge of #111973 - Sp00ph:update_current_impl, r=Amanieu
Update current implementation comments for `select_nth_unstable` This more accurately reflects the actual implementation, as it hasn't been a simple quickselect since #106997. While it does say that the current implementation always runs in O(n), I don't think it should require an FCP as it doesn't guarantee linearity in general and only points out that the current implementation is in fact linear. r? `@Amanieu`
This commit is contained in:
commit
18398ad337
@ -3005,8 +3005,9 @@ impl<T> [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
|
||||
///
|
||||
@ -3056,8 +3057,9 @@ impl<T> [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
|
||||
///
|
||||
|
Loading…
x
Reference in New Issue
Block a user