com.phasmidsoftware.sort
Members list
Type members
Classlikes
Simple implementation of insertion sort.
Simple implementation of insertion sort.
Works for small arrays but due to quadratic complexity is not generally good, unless array is partially sorted.
Attributes
- Supertypes
- Self type
-
InsertionSort.type
In-place merge sort implementation. This sort is stable but does mutate the given array. It is an in-place sort but it does allocate a temporary array of the same size as the input. It uses InsertionSort for sorting very small arrays.
In-place merge sort implementation. This sort is stable but does mutate the given array. It is an in-place sort but it does allocate a temporary array of the same size as the input. It uses InsertionSort for sorting very small arrays.
Attributes
- Supertypes
- Self type
-
MergeSort.type
In-place quicksort implementation. It is not stable, but does not allocate extra space (other than stack). Like MergeSort, it uses InsertionSort for sorting very small arrays.
In-place quicksort implementation. It is not stable, but does not allocate extra space (other than stack). Like MergeSort, it uses InsertionSort for sorting very small arrays.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
QuickSort.type
Interface for a sorting strategy object.
Interface for a sorting strategy object.
Attributes
- Supertypes
-
class Any
- Known subtypes
-
object InsertionSortobject MergeSort
Case class Sorted to enable different types of sort on a sequence.
Case class Sorted to enable different types of sort on a sequence.
This is not really part of the Comparer/Comparison code and should probably not be here.
Type parameters
- T
-
the underlying type of the sequence.
Value parameters
- comparer
-
the Comparer[T] which determines the order.
- ct
-
the ClassTag[T].
- ts
-
a sequence of T values.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait () => Seq[T]class Objecttrait Matchableclass AnyShow all
Object providing in-place sorting capability for arrays.
Object providing in-place sorting capability for arrays.
Sorting.sort() uses quickSort() by default (in-place, not stable, generally fastest but might hit bad cases where it's quadratic. Also provides mergeSort() (in-place, stable, uses extra memory, still pretty fast) and insertionSort(), which is slow except for small arrays.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Sorting.type