week8 format
This commit is contained in:
@@ -151,13 +151,11 @@ bool Check(int *A, int size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PrintClockInterval(clock_t start, clock_t end) {
|
void PrintClockInterval(clock_t start, clock_t end) {
|
||||||
printf("the time cost of this algorithms is %ld ms\n", (end - start) / (CLOCKS_PER_SEC / 1000));
|
printf("the time cost of this algorithms is %ld ms\n",
|
||||||
|
(end - start) / (CLOCKS_PER_SEC / 1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* use this to check small size of data */
|
/* use this to check small size of data */
|
||||||
void _PrintClockInterval(clock_t start, clock_t end) {
|
void _PrintClockInterval(clock_t start, clock_t end) {
|
||||||
printf("the time cost of this algorithms is %ld ms\n", (end - start));
|
printf("the time cost of this algorithms is %ld ms\n", (end - start));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
/* Sort array A[left..right] using quick sort
|
||||||
/* Sort array A[left..right] using quick sort */
|
* Pivot is picked using median-of-3 */
|
||||||
/* Pivot is picked using median-of-3 */
|
|
||||||
void QuickSort(int *A, int left, int right);
|
void QuickSort(int *A, int left, int right);
|
||||||
|
|
||||||
/* Sort the array in order */
|
/* Sort the array in order */
|
||||||
@@ -23,4 +22,3 @@ void PrintClockInterval(clock_t start, clock_t end);
|
|||||||
|
|
||||||
/* use this to check small size of data */
|
/* use this to check small size of data */
|
||||||
void _PrintClockInterval(clock_t start, clock_t end);
|
void _PrintClockInterval(clock_t start, clock_t end);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user