create a duplicate array

This commit is contained in:
Krishna Vedala 2020-04-01 23:48:04 -04:00
parent c697587605
commit 7ed48fffa5
No known key found for this signature in database
GPG Key ID: BA19ACF8FC8792F7

View File

@ -2,7 +2,7 @@
#include <stdlib.h>
#include <time.h>
#define ELEMENT_NR 20
#define ELEMENT_NR 20000
#define ARRAY_LEN(x) (sizeof(x) / sizeof((x)[0]))
const char *notation = "Shell Sort Big O Notation:\
\n--> Best Case: O(n log(n)) \
@ -68,6 +68,7 @@ int main(int argc, char *argv[])
{
int i;
int array[ELEMENT_NR];
int array2[ELEMENT_NR];
int range = 500;
int size;
clock_t start, end;
@ -75,7 +76,10 @@ int main(int argc, char *argv[])
srand(time(NULL));
for (i = 0; i < ELEMENT_NR; i++)
{
array[i] = rand() % range + 1;
array2[i] = array[i];
}
size = ARRAY_LEN(array);