Skip to content

Commit 8e6dbce

Browse files
committed
Update examples for mergesort
1 parent a05e7d9 commit 8e6dbce

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/sorting/mergesort.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*
2222
* @example
2323
* var array = [2, 4, 1, 5, 6, 7];
24+
* var mergeSort =
25+
* require('path-to-algorithms/src/sorting/mergesort').mergeSort;
2426
* mergeSort(array); // [1, 2, 4, 5, 6, 7]
2527
*/
2628
function mergeSort(array, cmp, start, end) {
@@ -52,6 +54,8 @@
5254
*
5355
* @example
5456
* var array = [1, 2, 3, 1, 4, 5, 6]
57+
* var merge =
58+
* require('path-to-algorithms/src/sorting/mergesort').merge;
5559
* merge(array, function (a, b) { // [1, 1, 2, 3, 4, 5, 6]
5660
* return a - b;
5761
* }, 0, 4, 7);

0 commit comments

Comments
 (0)