summaryrefslogtreecommitdiff
path: root/rushs/tinyprintf/quick_sort
diff options
context:
space:
mode:
Diffstat (limited to 'rushs/tinyprintf/quick_sort')
-rw-r--r--rushs/tinyprintf/quick_sort/quick_sort.c18
-rw-r--r--rushs/tinyprintf/quick_sort/quick_sort_example.c19
2 files changed, 0 insertions, 37 deletions
diff --git a/rushs/tinyprintf/quick_sort/quick_sort.c b/rushs/tinyprintf/quick_sort/quick_sort.c
deleted file mode 100644
index 6c61fc3..0000000
--- a/rushs/tinyprintf/quick_sort/quick_sort.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <stddef.h>
-
-void quicksort(int *tab, size_t len)
-{
- if (tab == NULL)
- {
- return;
- }
- for (size_t i = 1; i < len; i++)
- {
- for (size_t j = i; j > 0 && tab[j - 1] > tab[j]; j--)
- {
- int tmp = tab[j];
- tab[j] = tab[j - 1];
- tab[j - 1] = tmp;
- }
- }
-}
diff --git a/rushs/tinyprintf/quick_sort/quick_sort_example.c b/rushs/tinyprintf/quick_sort/quick_sort_example.c
deleted file mode 100644
index 2a5228f..0000000
--- a/rushs/tinyprintf/quick_sort/quick_sort_example.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <stdio.h>
-
-void quicksort(int *tab, int len);
-
-int main(void)
-{
- unsigned i = 0;
- int tab[] = { 10, 11, 2, 3, 8, 5, 7, 6, 26, 30, 2, 1, 17, 13, 14 };
-
- unsigned size = sizeof(tab) / sizeof(int);
-
- quicksort(tab, size);
-
- for (; i < size - 1; ++i)
- printf("%d ", tab[i]);
- printf("%d\n", tab[i]);
-
- return 0;
-}