UNPKG
algolibrary
Version:
latest (1.0.8)
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
A collection of efficient algorithms
github.com/gowrusreevathsa/algoLib
gowrusreevathsa/algoLib
algolibrary
/
sortLib
/
index.js
16 lines
(10 loc)
•
261 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var
bubbleSort =
require
(
'./bubbleSort'
);
function
sort
(
arr, compareFn
){
// Based on array length, we will select the sorting algorithm.
let
len = arr.
length
; bubbleSort.
sort
(arr, compareFn);
return
arr; }
module
.
exports
= { sort }