Skip to content

Commit 165d83a

Browse files
committed
Fix
1 parent f238dd1 commit 165d83a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

sorting/tim_sort.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,17 @@ void printArray(int arr[], int n) {
9595
* @brief self-test implementation
9696
* @returns void
9797
*/
98-
void test() {
98+
void tests() {
9999
// Case: array of length 65
100-
int arr[65];
100+
constexpr int N = 65;
101+
int arr[N];
101102

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));
103+
std::iota(arr, arr + N, 0);
104+
std::reverse(arr, arr + N);
105+
assert(!std::is_sorted(arr, arr + N));
108106

107+
timSort(arr, N);
108+
assert(std::is_sorted(arr, arr + N));
109109
}
110110

111111
// Driver program to test above function

0 commit comments

Comments
 (0)