Conceptcore
In-place and copying operations
Also called in place, in-place, mutating method, non-mutating method, destructive operation, non-destructive operation, sort versus sorted, copying method, sort and sorted, bang method.
An in-place operation changes the collection that it gets. A copying operation leaves it alone and returns a new collection. The name and the return value tell which one a function is.
- Applies to
- core-languages
Idea
A function that sorts, reverses or filters a collection can give its result in two ways. It can change the collection that the caller gave it, or it can leave that collection alone and return a new one. The first way is an in-place operation, also called a mutating or destructive operation. The second way is a copying operation, also called a non-mutating or non-destructive operation. Many libraries have both forms of the same operation, and the caller must know which form a name means.
# sorted() returns a new list and leaves nums alone.
nums = [3, 1, 2]
fresh = sorted(nums)
print(nums, fresh)
# list.sort() changes nums itself and returns None.
result = nums.sort()
print(nums, result)
# Two names for one list both see an in-place change.
a = [3, 1, 2]
b = a
a.sort()
print(b)
# A copying operation gives a new list to one name only.
a = [3, 1, 2]
b = a
a = sorted(a)
print(a, b)
[3, 1, 2] [1, 2, 3]
[1, 2, 3] None
[1, 2, 3]
[1, 2, 3] [3, 1, 2]
sorted(nums) makes a new list, so nums keeps its order. nums.sort() puts the items of nums in order and returns None. When two names refer to one list, an in-place sort through one name changes what the other name sees. After a = sorted(a), a refers to a new list, and b still refers to the old list in the old order.
How it works
In place. An in-place operation writes its result into the storage of the collection that it gets. It needs little or no extra memory, and the old content is gone after the call. Python says that list.sort() "modifies the sequence in place for economy of space when sorting a large sequence"1.
Copying. A copying operation reads the collection and builds a new one. The caller then has two collections: the original, which does not change, and the result. Python sorted() will "Return a new sorted list from the items in iterable"2. In JavaScript, "The toSorted() method of Array instances is the copying version of the sort() method"3.
The return value is a signal. Many in-place operations return nothing, so that the caller cannot mistake them for copies. The Python list method "does not return the sorted sequence (use sorted() to explicitly request a new sorted list instance)"1. The Python FAQ gives the reason: "This way, you won’t be fooled into accidentally overwriting a list when you need a sorted copy but also need to keep the unsorted version around"4. Java List.sort returns void, Rust sort returns (), and Go slices.Sort5 and C qsort6 return nothing. JavaScript takes the other choice: sort() "sorts the elements of an array in place and returns the reference to the same array, now sorted"7. So in JavaScript, const b = a.sort() gives a second name for a, not a sorted copy.
The name is a signal. Some libraries pair the two forms by a rule of names:
| Rule | In place | Copy | Where |
|---|---|---|---|
| verb and past participle | sort(), reverse() |
sorted(), reversed() |
Python, Swift, Kotlin |
prefix to |
sort(), reverse(), splice() |
toSorted(), toReversed(), toSpliced() |
JavaScript |
suffix ! |
sort!, uniq! |
sort, uniq |
Ruby, Scheme |
suffix _copy |
reverse, remove, rotate |
reverse_copy, remove_copy, rotate_copy |
C++ |
&mut self in the signature |
sort, reverse, retain |
to_vec, iter().rev().collect() |
Rust |
The Swift guidelines state the rule of the first row: "use the verb's imperative for the mutating method and apply the “ed” or “ing” suffix to name its nonmutating counterpart"8. Kotlin says that the in-place sorting functions have similar names to the copying ones, "but without the ed/d suffix"9. Ruby says that a bang method "permanently modifies its receiver"10, and Scheme says that the names of procedures that "store values into previously allocated locations" end in ! by convention11. The C++ algorithms library lists reverse next to reverse_copy and rotate next to rotate_copy12. In Rust, the type of the receiver tells: sort takes &mut self, and to_vec "Copies self into a new Vec"13. The task reverse a list shows both forms of reverse in ten languages.
Copies are shallow. A copying operation copies the container, not the items. MDN says of the copying array methods: "The copy always happens shallowly"14. Go slices.Clone copies the elements "using assignment, so this is a shallow clone"5. So when the items are objects, the original and the copy hold the same objects, and a change to an object shows in both.
Read-only collections force a copy. An in-place operation needs a collection that the program can change. Java List.of and List.copyOf make lists that are unmodifiable, and "Calling any mutator method on the List will always cause UnsupportedOperationException to be thrown"15. A program that has such a list must use the copying form.
In languages
| Language | Verdict | Note |
|---|---|---|
| Python | Native | |
| C++ | Native | |
| Java | Native | |
| C | Native | |
| C# | Native | |
| JavaScript | Native | |
| TypeScript | Native | TypeScript has the JavaScript methods, so sort and reverse mutate and toSorted and toReversed copy. The type ReadonlyArray has no mutating methods, so a call of sort on it does not compile. No example file exists. |
| Go | Native | |
| Rust | Native | |
| Kotlin | Native | Kotlin pairs the names. sort, reverse and shuffle change a MutableList, and sorted, reversed and shuffled return a new list from any collection. No example file exists because kotlinc is not installed. |
| SQL | Native | A SELECT with ORDER BY returns a sorted result and does not change the table, and UPDATE and DELETE change the rows of the table in place. No example file exists. |
| Bash | Idiom | Bash has no collection methods. The sort command reads its input and writes a new output, and it changes a file only when the -o option names that file. No example file exists. |
| PowerShell | Native | Sort-Object sends new sorted objects down the pipeline and does not change its input, and the .NET method [Array]::Sort sorts an array in place. No example file exists because pwsh is not installed. |
| HTML | Does not apply | HTML is markup. It has no operations that change or copy a collection. |
| CSS | Does not apply | CSS has no collections. The order property changes the visual order of flex and grid items, but the document order stays the same. |
| Regular expressions | Does not apply | A regular expression matches text. It does not sort, filter or change a collection. |
| Language | Verdict | Mechanism |
|---|---|---|
| Python | native | list.sort() and list.reverse() return None; sorted() returns a new list; reversed() returns an iterator |
| JavaScript | native | sort(), reverse() and splice() mutate; toSorted(), toReversed(), toSpliced() and with() copy |
| TypeScript | native | the JavaScript methods; ReadonlyArray has no mutating methods |
| Java | native | List.sort and Collections.sort mutate; stream().sorted().toList() copies; reversed() is a view |
| Kotlin | native | sort() and reverse() on a MutableList; sorted() and reversed() return a new list |
| C# | native | List<T>.Sort(), List<T>.Reverse() and Array.Sort mutate; LINQ OrderBy and Reverse return new sequences |
| Go | native | slices.Sort and slices.Reverse mutate; slices.Clone and slices.Sorted give new slices |
| Rust | native | sort, reverse and retain take &mut self; clone, to_vec and iterator chains make new vectors |
| C | native | qsort and strtok work in place; a copy is a memcpy into new storage |
| C++ | native | std::sort and std::reverse mutate; reverse_copy, remove_copy and the other _copy algorithms write to another range |
| Bash | idiom | the sort command writes a new output and does not change its input file unless -o names that file |
| PowerShell | native | Sort-Object sends new output down the pipeline; [Array]::Sort sorts an array in place |
| SQL | native | ORDER BY in a query returns a sorted result and does not change the table; UPDATE changes rows in place |
| Regex | n/a | a pattern does not change a collection |
| HTML | n/a | markup has no operations on collections |
| CSS | n/a | the order property changes the visual order of flex and grid items, not the document |
Every general-purpose language in the table has both forms. They differ in the default form, in the return value of the in-place form, and in the rule that names the two forms.
The example files show these differences. Python shows the None that sort(), shuffle() and reverse() return, the iterator of reversed(), the difference between += and a = a + b, and a shallow copy. JavaScript shows that sort() returns the same array, the copying methods toSorted(), toReversed() and with(), and a frozen array. Java shows an unmodifiable list, the write-through of Arrays.asList and the view of reversed(). C# shows the deferred OrderBy, the in-place List<T>.Reverse() and a copying call whose result is lost. Go shows slices.Sorted, slices.Clone and a subslice that shares its array. Rust shows &mut self, retain and lazy iterator adapters. C copies an array with memcpy before qsort, and shows that strtok changes its input. C++ shows the _copy algorithms and std::remove, which does not change the size.
import random
# list.sort() sorts in place and returns None. sorted() returns a new list.
nums = [3, 1, 2]
print(sorted(nums), nums)
print(nums.sort(), nums)
# The common bug: the name now holds None, not a list.
scores = [70, 90, 80]
scores = scores.sort()
print(scores)
# random.shuffle and list.reverse also work in place and return None.
deck = [1, 2, 3, 4]
print(random.shuffle(deck), deck.reverse(), len(deck))
# reversed() is neither: it returns an iterator over the same list.
letters = ["a", "b", "c"]
r = reversed(letters)
letters[0] = "z"
print(type(r).__name__, list(r))
# += changes the list in place, but a = a + b makes a new list.
a = [1, 2]
alias = a
a += [3]
print(alias)
a = a + [4]
print(alias, a)
# A copy is shallow: the new list holds the same inner lists.
rows = [[2, "b"], [1, "a"]]
ordered = sorted(rows)
ordered[0][1] = "changed"
print(rows)
[1, 2, 3] [3, 1, 2]
None [1, 2, 3]
None
None None 4
list_reverseiterator ['c', 'b', 'z']
[1, 2, 3]
[1, 2, 3] [1, 2, 3, 4]
[[2, 'b'], [1, 'changed']]
- Verdict: native.
sort(),random.shuffle()andreverse()work in place and returnNone, soscores = scores.sort()loses the list.reversed()returns an iterator over the same list, so a change after the call shows in it.+=changes the list in place and an alias sees it, buta = a + [4]makes a new list.sorted()copies only the outer list, so a change to an inner list shows in the original.
#include <algorithm>
#include <iostream>
#include <iterator>
#include <vector>
static void show(const char *label, const std::vector<int> &v) {
std::cout << label;
for (int x : v) std::cout << ' ' << x;
std::cout << '\n';
}
int main() {
// std::ranges::sort sorts the vector in place.
std::vector<int> nums{3, 1, 2};
std::ranges::sort(nums);
show("sorted:", nums);
// A copy of a vector is a new vector, so sort the copy.
const std::vector<int> src{3, 1, 2};
std::vector<int> copy = src;
std::ranges::sort(copy);
show("src:", src);
show("copy:", copy);
// The _copy algorithms write the result to another range.
std::vector<int> back;
std::ranges::reverse_copy(src, std::back_inserter(back));
show("reverse_copy:", back);
// std::remove moves the kept items forward, but the size stays the same.
std::vector<int> v{1, 0, 2, 0, 3};
auto tail = std::remove(v.begin(), v.end(), 0);
std::cout << "after remove: size " << v.size() << ", kept " << (tail - v.begin()) << '\n';
v.erase(tail, v.end());
show("after erase:", v);
// C++20 std::erase does both steps.
std::vector<int> w{1, 0, 2, 0, 3};
std::erase(w, 0);
show("std::erase:", w);
}
sorted: 1 2 3
src: 3 1 2
copy: 1 2 3
reverse_copy: 2 1 3
after remove: size 5, kept 3
after erase: 1 2 3
std::erase: 1 2 3
- Verdict: native.
std::ranges::sortsorts in place, and a copy of astd::vectoris a new vector to sort.reverse_copywrites the result to another range.std::removemoves the kept items to the front but keeps the size, so the program must callerase, and C++20std::erasedoes both steps.
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class Main {
public static void main(String[] args) {
// List.sort and Collections.sort work in place and return void.
List<Integer> nums = new ArrayList<>(List.of(3, 1, 2));
nums.sort(null);
System.out.println(nums);
// A stream makes a new list and leaves the source alone.
List<Integer> src = new ArrayList<>(List.of(3, 1, 2));
List<Integer> sorted = src.stream().sorted().toList();
System.out.println(src + " " + sorted);
// The list from toList() and List.of() is unmodifiable.
try {
sorted.sort(null);
} catch (UnsupportedOperationException e) {
System.out.println("UnsupportedOperationException");
}
// Arrays.asList is a fixed-size view of the array, so sorting it sorts the array.
Integer[] arr = {3, 1, 2};
Collections.sort(Arrays.asList(arr));
System.out.println(Arrays.toString(arr));
// reversed() is a view: a later change to the list shows in it.
List<String> letters = new ArrayList<>(List.of("a", "b", "c"));
List<String> back = letters.reversed();
letters.add("d");
System.out.println(back);
// To get a sorted copy of a mutable list, copy it first.
List<Integer> copy = new ArrayList<>(src);
Collections.sort(copy);
System.out.println(src + " " + copy);
}
}
[1, 2, 3]
[3, 1, 2] [1, 2, 3]
UnsupportedOperationException
[1, 2, 3]
[d, c, b, a]
[3, 1, 2] [1, 2, 3]
- Verdict: native.
List.sortandCollections.sortchange the list and returnvoid.stream().sorted().toList()makes a new list, and that list is unmodifiable, sosorton it throwsUnsupportedOperationException.Arrays.asListis a view of its array, so sorting the view sorts the array.reversed()is a view too, so a lateraddshows in it.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static int by_value(const void *a, const void *b) {
int x = *(const int *)a, y = *(const int *)b;
return (x > y) - (x < y);
}
static void show(const char *label, const int *a, size_t n) {
printf("%s", label);
for (size_t i = 0; i < n; i++) printf(" %d", a[i]);
printf("\n");
}
int main(void) {
/* qsort sorts the array in place and returns nothing. */
int nums[] = {3, 1, 2};
qsort(nums, 3, sizeof nums[0], by_value);
show("sorted:", nums, 3);
/* To keep the original, copy it first, then sort the copy. */
int src[] = {3, 1, 2};
int copy[3];
memcpy(copy, src, sizeof src);
qsort(copy, 3, sizeof copy[0], by_value);
show("src:", src, 3);
show("copy:", copy, 3);
/* strtok also works in place: it writes a null character into the text. */
char text[] = "a,b,c";
char *first = strtok(text, ",");
printf("%s %s %zu\n", first, text, strlen(text));
return 0;
}
sorted: 1 2 3
src: 3 1 2
copy: 1 2 3
a a 1
- Verdict: native.
qsortsorts the array in place and returns nothing, so the program copies the array withmemcpyto keep the original.strtokalso works in place: it writes a null character after the first token, sotextreads asaand its length is 1.
using System;
using System.Collections.Generic;
using System.Linq;
// List<T>.Sort works in place and returns void.
var nums = new List<int> { 3, 1, 2 };
nums.Sort();
Console.WriteLine(string.Join(",", nums));
// OrderBy returns a new sequence, and it runs only when the program enumerates it.
var src = new List<int> { 3, 1, 2 };
var query = src.OrderBy(n => n);
src.Add(0);
Console.WriteLine(string.Join(",", src) + " | " + string.Join(",", query));
// ToList takes a snapshot.
var snapshot = src.OrderBy(n => n).ToList();
src.Add(-1);
Console.WriteLine(string.Join(",", snapshot));
// On a List<T>, Reverse() is the in-place method, not the LINQ copy.
var letters = new List<string> { "a", "b", "c" };
letters.Reverse();
Console.WriteLine(string.Join(",", letters));
var copy = Enumerable.Reverse(letters).ToList();
Console.WriteLine(string.Join(",", letters) + " | " + string.Join(",", copy));
// Array.Sort works in place on an array.
int[] arr = { 3, 1, 2 };
Array.Sort(arr);
Console.WriteLine(string.Join(",", arr));
// A copying call that drops its result changes nothing.
var marks = new List<int> { 3, 1, 2 };
marks.OrderBy(n => n);
Console.WriteLine(string.Join(",", marks));
1,2,3
3,1,2,0 | 0,1,2,3
0,1,2,3
c,b,a
c,b,a | a,b,c
1,2,3
3,1,2
- Verdict: native.
List<T>.Sort()changes the list.OrderByreturns a new sequence with deferred execution, so the item that the program adds after the call shows in the result, andToList()takes a snapshot. On aList<T>,Reverse()is the in-place method, andEnumerable.Reversemakes a copy. A copying call such asmarks.OrderBy(n => n);that drops its result changes nothing.
// sort() sorts in place and returns the same array.
const a = [3, 1, 2];
const b = a.sort();
console.log(a, b, a === b);
// toSorted() returns a new array and leaves the original alone.
const c = [3, 1, 2];
const d = c.toSorted();
console.log(c, d, c === d);
// reverse() also mutates; toReversed() copies.
const e = [1, 2, 3];
const f = e.toReversed();
e.reverse();
console.log(e, f);
// with() is the copying form of an index assignment.
const g = [1, 2, 3];
console.log(g.with(0, 9), g);
// The default order compares strings, in place or not.
console.log([10, 9, 1].toSorted(), [10, 9, 1].toSorted((x, y) => x - y));
// The copy is shallow: both arrays hold the same objects.
const people = [{ name: "b" }, { name: "a" }];
const byName = people.toSorted((x, y) => x.name.localeCompare(y.name));
byName[0].name = "changed";
console.log(people.map((p) => p.name));
// A frozen array rejects sort(), but toSorted() works.
const frozen = Object.freeze([2, 1]);
try {
frozen.sort();
} catch (err) {
console.log(err.constructor.name);
}
console.log(frozen.toSorted());
[ 1, 2, 3 ] [ 1, 2, 3 ] true
[ 3, 1, 2 ] [ 1, 2, 3 ] false
[ 3, 2, 1 ] [ 3, 2, 1 ]
[ 9, 2, 3 ] [ 1, 2, 3 ]
[ 1, 10, 9 ] [ 1, 9, 10 ]
[ 'b', 'changed' ]
TypeError
[ 1, 2 ]
- Verdict: native.
sort()returns the same array, soa === bistrue.toSorted(),toReversed()andwith()return new arrays and leave the original alone. Both forms compare strings by default, so a numeric sort needs(x, y) => x - y. The copy is shallow, so a change to an object shows in both arrays.sort()on a frozen array throws aTypeError, buttoSorted()works.
package main
import (
"fmt"
"maps"
"slices"
"sort"
)
func main() {
// slices.Sort sorts the slice in place.
nums := []int{3, 1, 2}
slices.Sort(nums)
fmt.Println(nums)
// slices.Sorted collects an iterator into a new sorted slice.
src := []int{3, 1, 2}
fresh := slices.Sorted(slices.Values(src))
fmt.Println(src, fresh)
// To sort a copy of a slice, clone it first.
copied := slices.Clone(src)
slices.Sort(copied)
fmt.Println(src, copied)
// The keys of a map come out in a new slice.
ages := map[string]int{"b": 2, "a": 1, "c": 3}
fmt.Println(slices.Sorted(maps.Keys(ages)))
// A subslice shares its array, so sorting it changes the whole slice.
all := []int{9, 8, 7, 6}
sort.Ints(all[:2])
fmt.Println(all)
// append can write into the shared array too.
base := []int{1, 2, 3}
head := base[:2]
head = append(head, 99)
fmt.Println(base, head)
}
[1 2 3]
[3 1 2] [1 2 3]
[3 1 2] [1 2 3]
[a b c]
[8 9 7 6]
[1 2 99] [1 2 99]
- Verdict: native.
slices.Sortchanges the slice.slices.Sortedcollects an iterator into a new slice, andslices.Clonemakes a copy to sort. A subslice shares the array of its slice, sosort.Ints(all[:2])changesall, andappendonbase[:2]writes99intobase.
fn main() {
// sort takes &mut self: it changes the vector, and the binding must be mut.
let mut nums = vec![3, 1, 2];
nums.sort();
println!("{:?}", nums);
// To keep the original, sort a clone.
let src = vec![3, 1, 2];
let mut copy = src.clone();
copy.sort();
println!("{:?} {:?}", src, copy);
// retain filters in place; filter and collect build a new vector.
let mut evens = vec![1, 2, 3, 4];
evens.retain(|n| n % 2 == 0);
let odds: Vec<i32> = src.iter().copied().filter(|n| n % 2 == 1).collect();
println!("{:?} {:?}", evens, odds);
// An iterator adapter is lazy and does not change the vector.
let letters = vec!['a', 'b', 'c'];
let back: String = letters.iter().rev().collect();
println!("{:?} {}", letters, back);
// reverse is the in-place form.
let mut word = vec!['a', 'b', 'c'];
word.reverse();
println!("{:?}", word);
// sort returns (), the unit value, so there is no sorted vector to chain.
let mut marks = vec![3, 1, 2];
let result = marks.sort();
println!("{:?} {:?}", result, marks);
}
[1, 2, 3]
[3, 1, 2] [1, 2, 3]
[2, 4] [3, 1]
['a', 'b', 'c'] cba
['c', 'b', 'a']
() [1, 2, 3]
- Verdict: native.
sorttakes&mut self, so the binding must bemut, and it returns().clonegives a copy to sort.retainfilters in place, andfilterwithcollectbuilds a new vector.iter().rev()is lazy and does not change the vector, andreverseis the in-place form.
Variations and related ideas
- Views. A view is neither a copy nor an in-place change. It is a new object that reads the original. Java
reversed()"Returns a reverse-ordered view of this collection"16, and Pythonreversed()returns an iterator over the list. A later change to the original shows in the view. - Lazy copies. C# LINQ
OrderBy"is implemented by using deferred execution"17, so the sort happens when the program enumerates the result, not when it callsOrderBy. Iterator chains in Rust and Java streams also wait for a terminal operation. - Read-only types. A type can remove the mutating methods. In TypeScript, "The ReadonlyArray is a special type that describes arrays that shouldn’t be changed"18, so
sort()on aReadonlyArraydoes not compile. See immutability. - Copy-on-write. A copy can share storage with its original until one of them changes. See copy-on-write.
- In-place algorithms. In the study of algorithms, an in-place algorithm uses a small, fixed amount of extra memory. A library sort that is in place for the caller can still use temporary storage inside.
Pitfalls
- Assigning the result of an in-place call.
scores = scores.sort()in Python setsscorestoNone. Python returnsNonefrom such methods "to avoid confusion"19, but the assignment still loses the list. - Two names for one array.
const b = a.sort()in JavaScript does not make a copy, so a later change tobchangesa. UsetoSorted()or[...a].sort(). - Dropping the result of a copying call. A C# statement
list.OrderBy(n => n);or a Python statementsorted(nums)changes nothing, because the program does not use the new collection. nilfrom a bang method. Rubyuniq!"returns self if any elements removed, nil otherwise"20, soa.uniq!.sizefails on an array that has no duplicates.- Shared storage. A Go subslice shares its array, so
sort.Ints(all[:2])changesall, andappendon a short subslice can overwrite the next item of the original. - Shallow copies. A sorted copy of a list of lists holds the same inner lists, so a change to an inner list shows in the original.
- Hidden in-place work. C
strtokwrites null characters into its argument, and C++std::removemoves items but keeps the size, so the program must callerase.
Cost
An in-place operation needs no new collection, so its extra memory is small. Some in-place operations still need temporary memory inside: a merge sort, for example, uses a buffer. A copying operation allocates a new collection of n items and copies n references or values, so it costs O(n) time and memory on top of the work of the operation. For a sort, this extra O(n) is small next to the O(n log n) comparisons, and the Python Sorting HOWTO says that list.sort() is "slightly more efficient"19 than sorted() when the program does not need the original. The copy also removes a class of errors: no other part of the program sees a change that it did not expect.
History
Lisp calls an in-place operation destructive. The Common Lisp standard says that "sort and stable-sort destructively sort sequences"21, and it pairs reverse with nreverse: "reverse always creates and returns a new sequence, whereas nreverse might modify and return the given sequence"22. Scheme marks a procedure that changes storage with !11, and Ruby uses the ! in the same way for its bang methods10.
Python had only the in-place list.sort() until Python 2.4. That release added "a new built-in function sorted(iterable) that works like the in-place list.sort() method but can be used in expressions"23. JavaScript had only the mutating sort() and reverse() until the Change Array by copy proposal, which "Provides additional methods on Array.prototype and TypedArray.prototype to enable changes on the array by returning a new copy of it with the change"24. MDN says that toSorted() has been available across browsers since July 20233.
References
- Built-in Types, Python documentation, Lists; sort
- Built-in Functions, Python documentation, sorted
- Array.prototype.toSorted(), MDN Web Docs, Introduction
- Design and History FAQ, Python documentation, Why doesn't list.sort() return the sorted list?
- Package slices, Go standard library, Clone; Reverse; Sort; Sorted
- qsort, qsort_s, C reference, cppreference.com, Description
- Array.prototype.sort(), MDN Web Docs, Introduction
- API Design Guidelines, Swift.org, Strive for Fluent Usage; Name Mutating/nonmutating method pairs consistently
- List-specific operations, Kotlin documentation, Sorting
- Methods, Ruby documentation, Method Names
- Revised5 Report on the Algorithmic Language Scheme, 1.3.5 Naming conventions
- Algorithms library, C++ reference, cppreference.com, Modifying sequence operations; Order-changing operations
- Primitive Type slice, The Rust Standard Library, sort; to_vec
- Array, MDN Web Docs, Copying methods and mutating methods
- Interface List, Java SE 25 API, Unmodifiable Lists; sort
- Interface SequencedCollection, Java SE 25 API, reversed
- Enumerable.OrderBy Method, .NET API reference, Remarks
- Object Types, The TypeScript Handbook, The ReadonlyArray Type
- Sorting Techniques, Python documentation, Sorting Basics
- class Array, Ruby documentation, uniq!
- Function SORT, STABLE-SORT, Common Lisp HyperSpec, Description
- Function REVERSE, NREVERSE, Common Lisp HyperSpec, Description
- What's New in Python 2.4, Python documentation, Other Language Changes
- Change Array by copy, TC39 proposal, Introduction; Overview
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag GRNRV1 Edit this page History Report an error Markdown