-
Notifications
You must be signed in to change notification settings - Fork 0
/
Index.js
41 lines (38 loc) · 1.32 KB
/
Index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
var MergeSort = require('./src/MergeSort');
var InsertionSort = require('./src/InsertionSort');
var HeapSort = require('./src/HeapSort');
var ShakerSort= require('./src/ShakerSort');
var PeakFinding = require('./src/PeakFinding');
var BinarySearch = require('./src/BinarySearch');
var QuickSort = require('./src/QuickSort');
var SelectionSort = require('./src/SelectionSort');
exports.sort = {
InsertionSort : function(a){
InsertionSort.Sort.InsertionSort(a);
},
MergeSort : function (array){
left = 0
right= array.length -1;
MergeSort.Sort.MergeSort(array,left,right);
},
HeapSort:function(array){
HeapSort.Sort.HeapSort(array,array.length);
},
ShakerSort:function(array){
ShakerSort.Sort.shakerSort(array);
},
QuickSort:function(array){
QuickSort.Sort.quickSort(array,0,array.length-1);
},
SelectionSort:function(array){
SelectionSort.Sort.SelectionSort(array);
}
}
exports.find={
PeakFinding1D:function(array){
PeakFinding.Find.PeakFinding1D(array);
},
BinarySearch:function(key,array){
BinarySearch.Find.BinarySearch(key,array,0,array.length);
}
}