Написал 7е задание на быструю сортировку
This commit is contained in:
parent
c6539e2868
commit
c33f7295d5
10 changed files with 280 additions and 22 deletions
27
Sorting/7Ex/main.c
Normal file
27
Sorting/7Ex/main.c
Normal file
|
@ -0,0 +1,27 @@
|
|||
#include <stdio.h>
|
||||
#include "quicksort.h"
|
||||
#include "tools.h"
|
||||
#include "stdlib.h"
|
||||
|
||||
int main(void) {
|
||||
FILE * file = getFile();
|
||||
double * array;
|
||||
double * orig_arr;
|
||||
int length;
|
||||
|
||||
if (file == NULL) return -1;
|
||||
array = getArray(file);
|
||||
if (array == NULL) return -2;
|
||||
length = (int)array[0] - 1;
|
||||
|
||||
orig_arr = array;
|
||||
array = &array[1];
|
||||
testSort(array, length, quicksort);
|
||||
|
||||
free(orig_arr);
|
||||
|
||||
printf("\n");
|
||||
testSortRandomArray(quicksort);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue