智能照明系统APP-本地串口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
LightingSystemApp-serial/.svn/pristine/25/25dd536c67b375a7153e2bd5eaa...

23 lines
482 B

var Heap = require('./Heap');
var isSorted = require('./isSorted');
exports = function(arr) {
var cmp =
arguments.length > 1 && arguments[1] !== undefined
? arguments[1]
: isSorted.defComparator;
var heap = new Heap(cmp);
var len = arr.length;
for (var i = 0; i < len; i++) {
heap.add(arr[i]);
}
for (var _i = 0; _i < len; _i++) {
arr[_i] = heap.poll();
}
return arr;
};
module.exports = exports;