Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximSmolskiy committed Aug 22, 2024
1 parent f238dd1 commit 165d83a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions sorting/tim_sort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,17 @@ void printArray(int arr[], int n) {
* @brief self-test implementation
* @returns void
*/
void test() {
void tests() {
// Case: array of length 65
int arr[65];
constexpr int N = 65;
int arr[N];

std::iota(arr, arr + n, 0);
std::reverse(arr, arr + n);
assert(!std::is_sorted(arr, arr + n));

timSort(arr, n);
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));

timSort(arr, N);
assert(std::is_sorted(arr, arr + N));
}

// Driver program to test above function
Expand Down

0 comments on commit 165d83a

Please sign in to comment.