Skip to content

Commit

Permalink
Improved test code for slow_sort.c
Browse files Browse the repository at this point in the history
  • Loading branch information
CheerfulBear22 committed Feb 7, 2025
1 parent b2d67f0 commit 098edd5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sorting/slow_sort.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <assert.h>

/*Displays array passed as parameter*/
void display(int arr[], int size)
Expand Down Expand Up @@ -57,6 +58,11 @@ void test()

slowsort(arr, 0, size-1);

for (int i = 0; i < size - 1; i++)
{
assert(arr[i] <= arr[i+1]);
}

display(arr, size);

free(arr);
Expand Down

0 comments on commit 098edd5

Please sign in to comment.