MergeSortIndirect

scalation.MergeSortIndirect
class MergeSortIndirect(a: Array[ValueType])(perm: Array[Int])

The MergeSortIndirect class provides an implementation of Indirect Merge Sort, a version of mergesort that does not re-arrange the array, but modifies an Int array called perm such that perm(i) is the index of the i-th smallest entry in the array (i.e., a(perm(i)) <= a(perm(i+1)). The isort method returns the permutation that sorts array a in perm.

Value parameters

a

the array to be indirectly sorted

perm

the initial permutation, either 0 until a.length or result of last isort

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def isort(): Array[Int]

Indirectly sort the array 'a' by updating the permutation array 'perm'.

Indirectly sort the array 'a' by updating the permutation array 'perm'.

Attributes