ArraySort
haxe.ds.ArraySort (Class)
ArraySort provides a stable implementation of merge sort through its sort
method. It should be used instead of Array.sort
in cases where the order
of equal elements has to be retained on all targets.
Static Members
Sorts Array a
according to the comparison function cmp
, where
cmp(x,y)
returns 0 if x == y
, a positive Int if x > y
and a
negative Int if x < y
.
This operation modifies Array a
in place.
This operation is stable: The order of equal elements is preserved.
If a
or cmp
are null, the result is unspecified.
Name | Type |
---|---|
a |
Array<sort.T> |
cmp |
Function |
Private Members
Name | Type |
---|---|
a |
Array<rec.T> |
cmp |
Function |
from |
Int |
to |
Int |
doMerge(a: Array<doMerge.T>, cmp: Function, from: Int, pivot: Int, to: Int, len1: Int, len2: Int): Void
Name | Type |
---|---|
a |
Array<doMerge.T> |
cmp |
Function |
from |
Int |
pivot |
Int |
to |
Int |
len1 |
Int |
len2 |
Int |
Name | Type |
---|---|
a |
Array<rotate.T> |
cmp |
Function |
from |
Int |
mid |
Int |
to |
Int |
Name | Type |
---|---|
m |
Int |
n |
Int |
Returns |
---|
Int |
Name | Type |
---|---|
a |
Array<upper.T> |
cmp |
Function |
from |
Int |
to |
Int |
val |
Int |
Returns |
---|
Int |
Name | Type |
---|---|
a |
Array<lower.T> |
cmp |
Function |
from |
Int |
to |
Int |
val |
Int |
Returns |
---|
Int |
Name | Type |
---|---|
a |
Array<swap.T> |
i |
Int |
j |
Int |
Name | Type |
---|---|
a |
Array<compare.T> |
cmp |
Function |
i |
Int |
j |
Int |
Returns |
---|
Int |