Sort array a
with quicksort, using the Ordering on its elements.
Sort array a
with quicksort, using the Ordering on its elements.
This algorithm sorts in place, so no additional memory is used aside from
what might be required to box individual elements during comparison.
Sort an array of Floats using java.util.Arrays.sort
.
Sort an array of Ints using java.util.Arrays.sort
.
Sort an array of Doubles using java.util.Arrays.sort
.
A sorted Array, given an extraction function f
that returns an ordered key for each item in the sequence a
.
A sorted Array, given an extraction function f
that returns an ordered key for each item in the sequence a
. Uses java.util.Arrays.sort
unless K
is a primitive type.
A sorted Array, given a function f
that computes the less-than relation for each item in the sequence a
.
A sorted Array, given a function f
that computes the less-than relation for each item in the sequence a
. Uses java.util.Arrays.sort
unless K
is a primitive type.
A sorted Array, using the Ordering for the elements in the sequence a
.
A sorted Array, using the Ordering for the elements in the sequence a
. Uses java.util.Arrays.sort
unless K
is a primitive type.
Sort array a
using function f
that computes the less-than relation for each element.
Sort array a
using function f
that computes the less-than relation for each element. Uses java.util.Arrays.sort
unless K
is a primitive type.
Sort array a
using the Ordering on its elements, preserving the original ordering where possible.
Sort array a
using the Ordering on its elements, preserving the original ordering where possible. Uses java.util.Arrays.sort
unless K
is a primitive type.
The
Sorting
object provides convenience wrappers forjava.util.Arrays.sort
. Methods that defer tojava.util.Arrays.sort
say that they do or under what conditions that they do.Sorting
also implements a general-purpose quicksort and stable (merge) sort for those cases wherejava.util.Arrays.sort
could only be used at the cost of a large memory penalty. If performance rather than memory usage is the primary concern, one may wish to find alternate strategies to usejava.util.Arrays.sort
directly e.g. by boxing primitives to use a custom ordering on them.Sorting
provides methods where you can provide a comparison function, or can request a sort of items that are scala.math.Ordered or that otherwise have an implicit or explicit scala.math.Ordering.Note also that high-performance non-default sorts for numeric types are not provided. If this is required, it is advisable to investigate other libraries that cover this use case.
1.1