mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 09:13:07 +03:00
Rollup merge of #106933 - schuelermine:fix/doc/102451, r=Amanieu
Update documentation of select_nth_unstable and select_nth_unstable_by to state O(n^2) complexity See #102451
This commit is contained in:
@@ -2730,8 +2730,10 @@ pub fn sort_unstable_by_key<K, F>(&mut self, mut f: F)
|
||||
/// This reordering has the additional property that any value at position `i < index` will be
|
||||
/// less than or equal to any value at a position `j > index`. Additionally, this reordering is
|
||||
/// unstable (i.e. any number of equal elements may end up at position `index`), in-place
|
||||
/// (i.e. does not allocate), and *O*(*n*) worst-case. This function is also/ known as "kth
|
||||
/// element" in other libraries. It returns a triplet of the following from the reordered slice:
|
||||
/// (i.e. does not allocate), and *O*(*n*) on average. The worst-case performance is *O*(*n* log *n*).
|
||||
/// This function is also known as "kth element" in other libraries.
|
||||
///
|
||||
/// It returns a triplet of the following from the reordered slice:
|
||||
/// the subslice prior to `index`, the element at `index`, and the subslice after `index`;
|
||||
/// accordingly, the values in those two subslices will respectively all be less-than-or-equal-to
|
||||
/// and greater-than-or-equal-to the value of the element at `index`.
|
||||
@@ -2777,8 +2779,11 @@ pub fn select_nth_unstable(&mut self, index: usize) -> (&mut [T], &mut T, &mut [
|
||||
/// This reordering has the additional property that any value at position `i < index` will be
|
||||
/// less than or equal to any value at a position `j > index` using the comparator function.
|
||||
/// Additionally, this reordering is unstable (i.e. any number of equal elements may end up at
|
||||
/// position `index`), in-place (i.e. does not allocate), and *O*(*n*) worst-case. This function
|
||||
/// is also known as "kth element" in other libraries. It returns a triplet of the following from
|
||||
/// position `index`), in-place (i.e. does not allocate), and *O*(*n*) on average.
|
||||
/// The worst-case performance is *O*(*n* log *n*). This function is also known as
|
||||
/// "kth element" in other libraries.
|
||||
///
|
||||
/// It returns a triplet of the following from
|
||||
/// the slice reordered according to the provided comparator function: the subslice prior to
|
||||
/// `index`, the element at `index`, and the subslice after `index`; accordingly, the values in
|
||||
/// those two subslices will respectively all be less-than-or-equal-to and greater-than-or-equal-to
|
||||
@@ -2829,8 +2834,11 @@ pub fn select_nth_unstable_by<F>(
|
||||
/// This reordering has the additional property that any value at position `i < index` will be
|
||||
/// less than or equal to any value at a position `j > index` using the key extraction function.
|
||||
/// Additionally, this reordering is unstable (i.e. any number of equal elements may end up at
|
||||
/// position `index`), in-place (i.e. does not allocate), and *O*(*n*) worst-case. This function
|
||||
/// is also known as "kth element" in other libraries. It returns a triplet of the following from
|
||||
/// position `index`), in-place (i.e. does not allocate), and *O*(*n*) on average.
|
||||
/// The worst-case performance is *O*(*n* log *n*).
|
||||
/// This function is also known as "kth element" in other libraries.
|
||||
///
|
||||
/// It returns a triplet of the following from
|
||||
/// the slice reordered according to the provided key extraction function: the subslice prior to
|
||||
/// `index`, the element at `index`, and the subslice after `index`; accordingly, the values in
|
||||
/// those two subslices will respectively all be less-than-or-equal-to and greater-than-or-equal-to
|
||||
|
||||
Reference in New Issue
Block a user