mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
Update wave_sort.cpp
This commit is contained in:
parent
838a9e2e11
commit
196165e792
@ -53,7 +53,7 @@ static void test() {
|
||||
std::cout << "Test 1... ";
|
||||
std::vector<int> arr1 = sorting::wave_sort::waveSort(array1,7);
|
||||
const std::vector<int> o1 = {2, 1, 10, 5, 49, 23, 90};
|
||||
assert(std::equal(arr1.begin(),arr1.end(),o1.begin(),o1.end()));
|
||||
assert(arr1==o1);
|
||||
std::cout << "passed" << std::endl;
|
||||
|
||||
// [1, 3, 4, 2, 7, 8] return [2, 1, 4, 3, 8, 7]
|
||||
@ -61,7 +61,7 @@ static void test() {
|
||||
std::cout << "Test 2... ";
|
||||
std::vector<int> arr2 = sorting::wave_sort::waveSort(array2,6);
|
||||
const std::vector<int> o2 = {2, 1, 4, 3, 8, 7};
|
||||
assert(std::equal(arr2.begin(),arr2.end(),o2.begin(),o2.end()));
|
||||
assert(arr2==o2);
|
||||
std::cout << "passed" << std::endl;
|
||||
|
||||
// [3, 3, 3, 3] return [3, 3, 3, 3]
|
||||
@ -69,7 +69,7 @@ static void test() {
|
||||
std::cout << "Test 3... ";
|
||||
std::vector<int> arr3 = sorting::wave_sort::waveSort(array3,4);
|
||||
const std::vector<int> o3 = {3, 3, 3, 3};
|
||||
assert(std::equal(arr3.begin(),arr3.end(),o3.begin(),o3.end()));
|
||||
assert(arr3==o3);
|
||||
std::cout << "passed" << std::endl;
|
||||
|
||||
// [9, 4, 6, 8, 14, 3] return [4, 3, 8, 6, 14, 9]
|
||||
@ -77,7 +77,7 @@ static void test() {
|
||||
std::cout << "Test 4... ";
|
||||
std::vector<int> arr4 = sorting::wave_sort::waveSort(array4,6);
|
||||
const std::vector<int> o4 = {4, 3, 8, 6, 14, 9};
|
||||
assert(std::equal(arr4.begin(),arr4.end(),o4.begin(),o4.end()));
|
||||
assert(arr4==o4);
|
||||
std::cout << "passed" << std::endl;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user