Skip to content

Commit cdeb86b

Browse files
committed
sorting algorithms
1 parent 72bd70e commit cdeb86b

File tree

7 files changed

+42
-0
lines changed

7 files changed

+42
-0
lines changed

102-main.c

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include <stdio.h>
2+
#include <stdlib.h>
3+
#include "sort.h"
4+
5+
/**
6+
* main - Entry point
7+
*
8+
* Return: Always 0
9+
*/
10+
int main(void)
11+
{
12+
int array[] = {19, 48, 99, 71, 13, 52, 96, 73, 86, 7};
13+
size_t n = sizeof(array) / sizeof(array[0]);
14+
15+
print_array(array, n);
16+
printf("\n");
17+
counting_sort(array, n);
18+
printf("\n");
19+
print_array(array, n);
20+
return (0);
21+
}

3-main.c

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include <stdio.h>
2+
#include <stdlib.h>
3+
#include "sort.h"
4+
5+
/**
6+
* main - Entry point
7+
*
8+
* Return: Always 0
9+
*/
10+
int main(void)
11+
{
12+
int array[] = {19, 48, 99, 71, 13, 52, 96, 73, 86, 7};
13+
size_t n = sizeof(array) / sizeof(array[0]);
14+
15+
print_array(array, n);
16+
printf("\n");
17+
quick_sort(array, n);
18+
printf("\n");
19+
print_array(array, n);
20+
return (0);
21+
}

cocktail

16.7 KB
Binary file not shown.

counting

16.7 KB
Binary file not shown.

insertion

16.6 KB
Binary file not shown.

quick

16.7 KB
Binary file not shown.

select

16.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)