MCPcopy Index your code
hub / github.com/totaljs/framework / _shellInsertionSort

Function _shellInsertionSort

utils.js:6681–6692  ·  view source on GitHub ↗
(list, length, gapSize, fn)

Source from the content-addressed store, hash-verified

6679// =============================================
6680
6681function _shellInsertionSort(list, length, gapSize, fn) {
6682 var temp, i, j;
6683 for (i = gapSize; i < length; i += gapSize ) {
6684 j = i;
6685 while(j > 0 && fn(list[j - gapSize], list[j]) === 1) {
6686 temp = list[j];
6687 list[j] = list[j - gapSize];
6688 list[j - gapSize] = temp;
6689 j -= gapSize;
6690 }
6691 }
6692}
6693
6694function shellsort(arr, fn) {
6695 var length = arr.length;

Callers 1

shellsortFunction · 0.85

Calls 1

fnFunction · 0.70

Tested by

no test coverage detected