Skip to content

Sort

The elements of the collection in increasing order.

Wolfram LanguageSort
Sort(collection)the elements in increasing numeric order.
Sort(collection, comparator)sorted by a custom Function comparator, e.g. descending order.

Domain: Collections

Details
  • Idempotent: sorting an already-sorted collection changes nothing.
  • . See Ordering and At.
  • compute-engine's Sort compares numeric values and leaves non-numeric elements like strings untouched.
  • The comparator form `Sort(list, p)` takes a predicate `p` reporting whether a pair is already in order.

Examples

See also: Ordering