Skip to content

Commit 838a9e2

Browse files
authored
Update wave_sort.cpp
1 parent 759a4af commit 838a9e2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sorting/wave_sort.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,31 +52,31 @@ static void test() {
5252
std::vector<int> array1 = {10, 90, 49, 2, 1, 5, 23};
5353
std::cout << "Test 1... ";
5454
std::vector<int> arr1 = sorting::wave_sort::waveSort(array1,7);
55-
std::vector<int> o1 = {2, 1, 10, 5, 49, 23, 90};
55+
const std::vector<int> o1 = {2, 1, 10, 5, 49, 23, 90};
5656
assert(std::equal(arr1.begin(),arr1.end(),o1.begin(),o1.end()));
5757
std::cout << "passed" << std::endl;
5858

5959
// [1, 3, 4, 2, 7, 8] return [2, 1, 4, 3, 8, 7]
6060
std::vector<int> array2 = {1, 3, 4, 2, 7, 8};
6161
std::cout << "Test 2... ";
6262
std::vector<int> arr2 = sorting::wave_sort::waveSort(array2,6);
63-
std::vector<int> o2 = {2, 1, 4, 3, 8, 7};
63+
const std::vector<int> o2 = {2, 1, 4, 3, 8, 7};
6464
assert(std::equal(arr2.begin(),arr2.end(),o2.begin(),o2.end()));
6565
std::cout << "passed" << std::endl;
6666

6767
// [3, 3, 3, 3] return [3, 3, 3, 3]
6868
std::vector<int> array3 = {3, 3, 3, 3};
6969
std::cout << "Test 3... ";
7070
std::vector<int> arr3 = sorting::wave_sort::waveSort(array3,4);
71-
std::vector<int> o3 = {3, 3, 3, 3};
71+
const std::vector<int> o3 = {3, 3, 3, 3};
7272
assert(std::equal(arr3.begin(),arr3.end(),o3.begin(),o3.end()));
7373
std::cout << "passed" << std::endl;
7474

7575
// [9, 4, 6, 8, 14, 3] return [4, 3, 8, 6, 14, 9]
7676
std::vector<int> array4 = {9, 4, 6, 8, 14, 3};
7777
std::cout << "Test 4... ";
7878
std::vector<int> arr4 = sorting::wave_sort::waveSort(array4,6);
79-
std::vector<int> o4 = {4, 3, 8, 6, 14, 9};
79+
const std::vector<int> o4 = {4, 3, 8, 6, 14, 9};
8080
assert(std::equal(arr4.begin(),arr4.end(),o4.begin(),o4.end()));
8181
std::cout << "passed" << std::endl;
8282
}

0 commit comments

Comments
 (0)