Clarify time complexity
This commit is contained in:
parent
ca3bed0c66
commit
9896b38f01
2 changed files with 3 additions and 3 deletions
|
|
@ -113,7 +113,6 @@
|
|||
#![feature(slice_get_slice)]
|
||||
#![feature(slice_patterns)]
|
||||
#![feature(slice_rsplit)]
|
||||
#![feature(slice_sort_by_cached_key)]
|
||||
#![feature(specialization)]
|
||||
#![feature(staged_api)]
|
||||
#![feature(str_internals)]
|
||||
|
|
|
|||
|
|
@ -1303,7 +1303,7 @@ impl<T> [T] {
|
|||
|
||||
/// Sorts the slice with a key extraction function.
|
||||
///
|
||||
/// This sort is stable (i.e. does not reorder equal elements) and `O(m n log m n)`
|
||||
/// This sort is stable (i.e. does not reorder equal elements) and `O(m n log(m n))`
|
||||
/// worst-case, where the key function is `O(m)`.
|
||||
///
|
||||
/// For expensive key functions (e.g. functions that are not simple property accesses or
|
||||
|
|
@ -1365,6 +1365,7 @@ impl<T> [T] {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(slice_sort_by_cached_key)]
|
||||
/// let mut v = [-5i32, 4, 32, -3, 2];
|
||||
///
|
||||
/// v.sort_by_cached_key(|k| k.to_string());
|
||||
|
|
@ -1480,7 +1481,7 @@ impl<T> [T] {
|
|||
/// elements.
|
||||
///
|
||||
/// This sort is unstable (i.e. may reorder equal elements), in-place (i.e. does not allocate),
|
||||
/// and `O(m n log m n)` worst-case, where the key function is `O(m)`.
|
||||
/// and `O(m n log(m n))` worst-case, where the key function is `O(m)`.
|
||||
///
|
||||
/// # Current implementation
|
||||
///
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue