object MergeSort
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.
- Alphabetic
- By Inheritance
- MergeSort
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def merge[A](in: Array[A], out: Array[A], start: Int, mid: Int, end: Int)(implicit o: ORD[A]): Unit
Helper method for mergeSort, used to do a single "merge" between two sections of the input array, and write the result to the output array.
Helper method for mergeSort, used to do a single "merge" between two sections of the input array, and write the result to the output array.
The first input section starts at
start
(inclusive) and ends atmid
(exclusive). The second input section starts atmid
(inclusive) and ends atend
(exclusive).Writing to the output begins at
start
(inclusive).- A
a member of the type class
Order
- in
the input array
- out
the output array
- start
the start of the first input section (inclusive) as well as the start of the merged output
- mid
the end of the first input section (exclusive) and the beginning of the second input section (inclusive)
- end
the end of the second input section (exclusive)
- Annotations
- @inline()
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def sort[A](data: Array[A])(implicit arg0: ORD[A], arg1: ClassTag[A]): Unit
Uses merge sort to sort the array
data
in place.Uses merge sort to sort the array
data
in place.If the size of the input array does not exceed the threshold
startStep
, uses insertion sort instead.- A
a member of the type class
Order
- data
the array to be sorted
- final def startStep: Int
- Annotations
- @inline()
- final def startWidth: Int
- Annotations
- @inline()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()