Self-test implementations.
53 {
54
55 std::vector<int64_t> array1 = {10, 90, 49, 2, 1, 5, 23};
56 std::cout << "Test 1... ";
58 const std::vector<int64_t> o1 = {2, 1, 10, 5, 49, 23, 90};
59 assert(arr1 == o1);
60 std::cout << "passed" << std::endl;
61
62
63 std::vector<int64_t> array2 = {1, 3, 4, 2, 7, 8};
64 std::cout << "Test 2... ";
66 const std::vector<int64_t> o2 = {2, 1, 4, 3, 8, 7};
67 assert(arr2 == o2);
68 std::cout << "passed" << std::endl;
69
70
71 std::vector<int64_t> array3 = {3, 3, 3, 3};
72 std::cout << "Test 3... ";
74 const std::vector<int64_t> o3 = {3, 3, 3, 3};
75 assert(arr3 == o3);
76 std::cout << "passed" << std::endl;
77
78
79 std::vector<int64_t> array4 = {9, 4, 6, 8, 14, 3};
80 std::cout << "Test 4... ";
82 const std::vector<int64_t> o4 = {4, 3, 8, 6, 14, 9};
83 assert(arr4 == o4);
84 std::cout << "passed" << std::endl;
85}
std::vector< T > waveSort(const std::vector< T > &in_arr, int64_t n)
The main function implements that implements the Wave Sort algorithm.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4