We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f238dd1 commit 165d83aCopy full SHA for 165d83a
sorting/tim_sort.cpp
@@ -95,17 +95,17 @@ void printArray(int arr[], int n) {
95
* @brief self-test implementation
96
* @returns void
97
*/
98
-void test() {
+void tests() {
99
// Case: array of length 65
100
- int arr[65];
+ constexpr int N = 65;
101
+ int arr[N];
102
- std::iota(arr, arr + n, 0);
103
- std::reverse(arr, arr + n);
104
- assert(!std::is_sorted(arr, arr + n));
105
-
106
- timSort(arr, n);
107
- assert(std::is_sorted(arr, arr + n));
+ std::iota(arr, arr + N, 0);
+ std::reverse(arr, arr + N);
+ assert(!std::is_sorted(arr, arr + N));
108
+ timSort(arr, N);
+ assert(std::is_sorted(arr, arr + N));
109
}
110
111
// Driver program to test above function
0 commit comments