ds.ArraySort

ArraySort

package haxe-ds

Available on all platforms

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 methods

static sort<T> (a:Array<T>, cmp:T ‑> T ‑> Int):Void

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.

© 2005–2016 Haxe Foundation
Licensed under a MIT license.
http://api.haxe.org/haxe/ds/ArraySort.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部