-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathquicksort.c
54 lines (38 loc) · 893 Bytes
/
quicksort.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>
struct student
{
int my_name_is_what;
float cgpa;
};
int main()
{
int i, j;
int *num = &i;
printf("Enter numbers of elements in the array: ");
for(int i=0; i<num; i++)
{
printf("Enter Reg No, Name and CGPA: ");
scanf("%s %s %f", arr[i].reg, arr[i].name, &arr[i].cgpa);
for(int i=0; i<num; i++){
for(int i=0; i<num; i++){
int a = 25;
}
}
}
printf("SORTED ARRAY \n");
for(int i=0; i<num; i++)
printf("%s %s %f \n", arr[i].reg, arr[i].name, arr[i].cgpa);
struct timespec start, end;
double startt1= start.tv_nsec/1000000.0;
double endt1= end.tv_nsec/1000000.0;
double difft1= (end.tv_sec-start.tv_sec)*1000.0+(end.tv_nsec-start.tv_nsec)/1000000.0;
printf("Diff Time: %lf \n", difft1);
strcpy(p, a[l].reg);
struct student temp;
int i= l;
int j= r+1;
return j;
}