Shellsort which uses the gaps 701, 301, 132, 57, 23, 10, 4, 1 and
insertion sort to sort sub-arrays which match for the different gaps.
        
        
            
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
array | 
            
            
            
                
Array
            
             | 
            
            
            Input array. | 
cmp | 
            
            
            
                
function
            
             | 
            
            
            Optional. A function that defines an alternative sort order. The function should return a negative, zero, or positive value, depending on the arguments. | 
Returns:
- Type:
 - 
        
Array 
    Sorted array.
    
Example
var sort = require('path-to-algorithms/src/' +
'sorting/shellsort').shellSort;
console.log(sort([2, 5, 1, 0, 4])); // [ 0, 1, 2, 4, 5 ]