forked from CPRO-Session1/Assignment8
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsort.c
More file actions
39 lines (26 loc) · 709 Bytes
/
Copy pathsort.c
File metadata and controls
39 lines (26 loc) · 709 Bytes
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
//Justin Yu//
//This is definitely not completed but I couldn't figure the rest out. Sorry.//
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
int main() {
srand(time(NULL));
int num;
int i;
int *array
int *arrayAscend;
int *arrayDescend;
printf("Enter number of integers\n");
scanf("%d", &num);
array = (int*) malloc(sizeof(int)*num);
arrayAscend = (int*) malloc(sizeof(int)*num);
arrayDescend = (int*) malloc(sizeof(int)*num);
for(i = 0; i < num; i++) {
arrayAscend[i] = array[i];
arrayDescend[i] = array[i]; }
for(i = 0; i < num; i++) {
for(int j = 0; k < num - 2; j++)
// I'm not sure what to add here//
free(array);
free(arrayAscend);
free(arrayDescend);