196 std::vector<uint64_t> arr1 = {
197 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84,
198 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67,
199 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50,
200 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33,
201 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16,
202 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
203 uint32_t size1 = arr1.size();
204 uint32_t inv_count1 = 4950;
205 uint32_t result1 = sorting::inversion::countInversion(arr1.data(), size1);
206 assert(inv_count1 == result1);
208 std::vector<int> arr2 = {22, 66, 75, 23, 11, 87, 2, 44, 98, 43};
209 uint32_t size2 = arr2.size();
210 uint32_t inv_count2 = 20;
211 uint32_t result2 = sorting::inversion::countInversion(arr2.data(), size2);
212 assert(inv_count2 == result2);
214 std::vector<double> arr3 = {33.1, 45.2, 65.4, 76.5, 1.0,
215 2.9, 5.4, 7.7, 88.9, 12.4};
216 uint32_t size3 = arr3.size();
217 uint32_t inv_count3 = 21;
218 uint32_t result3 = sorting::inversion::countInversion(arr3.data(), size3);
219 assert(inv_count3 == result3);
221 std::vector<char> arr4 = {
'a',
'b',
'c',
'd',
'e'};
222 uint32_t size4 = arr4.size();
223 uint32_t inv_count4 = 0;
224 uint32_t result4 = sorting::inversion::countInversion(arr4.data(), size4);
225 assert(inv_count4 == result4);