fix generation of random numbers to be more dynamic

This commit is contained in:
Chris Cromer 2018-11-11 20:15:30 -03:00
parent 893d47bf2e
commit a31eababb7
Signed by: cromer
GPG Key ID: 39CC813FF3C8708A
2 changed files with 4 additions and 4 deletions

View File

@ -63,7 +63,7 @@ void print_array(int *array, int n) {
for (i = 0; i < n; i++) {
fprintf(stdout, "%d ", array[i]);
}
fprintf(stdout, "\n");
fprintf(stdout, "\n\n");
}
/**
@ -189,12 +189,12 @@ int main (int argc, char **argv) {
array[i] = opt;
}
else {
array[i] = gen_rand(-1000, 5000);
array[i] = gen_rand((n * 10) * -1, n * 10);
}
}
if (imprimir) {
fprintf(stdout, "\nAntes:\n");
fprintf(stdout, "Antes:\n");
print_array(array, n);
}

View File

@ -81,7 +81,7 @@ int main(int argc, char **argv) {
// Prepare for sort tests
for (i = 0; i < n; i++) {
test_case[i] = gen_rand(-20, 100);
test_case[i] = gen_rand(-100, 100);
}
memcpy(qarray, test_case, sizeof(int) * n);
memcpy(test_array, test_case, sizeof(int) * n);