summaryrefslogtreecommitdiff
path: root/algo1w2
diff options
context:
space:
mode:
Diffstat (limited to 'algo1w2')
-rw-r--r--algo1w2/main.c26
l---------algo1w2/makefile1
2 files changed, 27 insertions, 0 deletions
diff --git a/algo1w2/main.c b/algo1w2/main.c
new file mode 100644
index 0000000..4bc6c46
--- /dev/null
+++ b/algo1w2/main.c
@@ -0,0 +1,26 @@
+#include <stdio.h>
+
+void bubble_sort(int* arr, unsigned size) {
+ int outer, inner;
+ bool sorted = false;
+}
+
+void print_arr(int* arr, unsigned size) {
+ printf("[");
+ for (unsigned i = 0; i < size; i++) {
+ if (i > 0) printf(", ");
+ printf("%d", arr[i]);
+ }
+ printf("]\n");
+}
+
+int main() {
+ int arr[] = { 7, 3, 8, 1, 2, 5, 4, 6, 9, 0 };
+ unsigned size = sizeof(arr) / sizeof(int);
+
+ print_arr(arr, size);
+ bubble_sort(arr, size);
+ print_arr(arr, size);
+
+ return 0;
+}
diff --git a/algo1w2/makefile b/algo1w2/makefile
new file mode 120000
index 0000000..a4e84c6
--- /dev/null
+++ b/algo1w2/makefile
@@ -0,0 +1 @@
+../week.mk \ No newline at end of file