Skip to content

Commit f29bcab

Browse files
committed
Add merge sort.
1 parent 21ce971 commit f29bcab

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/algorithms/sorting/merge-sort/__test__/MergeSort.test.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import BubbleSort from '../MergeSort';
1+
import MergeSort from '../MergeSort';
22
import {
33
equalArr,
44
notSortedArr,
@@ -15,44 +15,44 @@ const EQUAL_ARRAY_VISITING_COUNT = 79;
1515

1616
describe('MergeSort', () => {
1717
it('should sort array', () => {
18-
SortTester.testSort(BubbleSort);
18+
SortTester.testSort(MergeSort);
1919
});
2020

2121
it('should sort array with custom comparator', () => {
22-
SortTester.testSortWithCustomComparator(BubbleSort);
22+
SortTester.testSortWithCustomComparator(MergeSort);
2323
});
2424

2525
it('should do stable sorting', () => {
26-
SortTester.testSortStability(BubbleSort);
26+
SortTester.testSortStability(MergeSort);
2727
});
2828

2929
it('should visit EQUAL array element specified number of times', () => {
3030
SortTester.testAlgorithmTimeComplexity(
31-
BubbleSort,
31+
MergeSort,
3232
equalArr,
3333
EQUAL_ARRAY_VISITING_COUNT,
3434
);
3535
});
3636

3737
it('should visit SORTED array element specified number of times', () => {
3838
SortTester.testAlgorithmTimeComplexity(
39-
BubbleSort,
39+
MergeSort,
4040
sortedArr,
4141
SORTED_ARRAY_VISITING_COUNT,
4242
);
4343
});
4444

4545
it('should visit NOT SORTED array element specified number of times', () => {
4646
SortTester.testAlgorithmTimeComplexity(
47-
BubbleSort,
47+
MergeSort,
4848
notSortedArr,
4949
NOT_SORTED_ARRAY_VISITING_COUNT,
5050
);
5151
});
5252

5353
it('should visit REVERSE SORTED array element specified number of times', () => {
5454
SortTester.testAlgorithmTimeComplexity(
55-
BubbleSort,
55+
MergeSort,
5656
reverseArr,
5757
REVERSE_SORTED_ARRAY_VISITING_COUNT,
5858
);

0 commit comments

Comments
 (0)