aboutsummaryrefslogtreecommitdiffstats
path: root/test_deliverable/testcases/test_SORT.c
diff options
context:
space:
mode:
Diffstat (limited to 'test_deliverable/testcases/test_SORT.c')
-rw-r--r--test_deliverable/testcases/test_SORT.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/test_deliverable/testcases/test_SORT.c b/test_deliverable/testcases/test_SORT.c
new file mode 100644
index 0000000..92f1416
--- /dev/null
+++ b/test_deliverable/testcases/test_SORT.c
@@ -0,0 +1,22 @@
+void sort(int *array, int size)
+{
+ int swapped=1;
+
+ while(swapped)
+ {
+ int i;
+
+ swapped=0;
+ for(i=1; i<size; ++i)
+ {
+ if(array[i-1]>array[i])
+ {
+ int tmp_el=array[i-1];
+
+ array[i-1]=array[i];
+ array[i]=tmp_el;
+ swapped=1;
+ }
+ }
+ }
+}