From 9f6449caef181ac0718ed3212801bff6010a7d5a Mon Sep 17 00:00:00 2001 From: ashish010598 <40847206+ashish010598@users.noreply.github.com> Date: Mon, 8 Oct 2018 02:29:29 +0530 Subject: [PATCH 1/2] Create hactoberfest_noob --- hactoberfest_noob | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 hactoberfest_noob diff --git a/hactoberfest_noob b/hactoberfest_noob new file mode 100644 index 0000000..600a5e1 --- /dev/null +++ b/hactoberfest_noob @@ -0,0 +1,42 @@ + +// C program for implementation of Bubble sort +#include + +void swap(int *xp, int *yp) +{ + int temp = *xp; + *xp = *yp; + *yp = temp; +} + +// A function to implement bubble sort +void bubbleSort(int arr[], int n) +{ + int i, j; + for (i = 0; i < n-1; i++) + + // Last i elements are already in place + for (j = 0; j < n-i-1; j++) + if (arr[j] > arr[j+1]) + swap(&arr[j], &arr[j+1]); +} + +/* Function to print an array */ +void printArray(int arr[], int size) +{ + int i; + for (i=0; i < size; i++) + printf("%d ", arr[i]); + printf("n"); +} + +// Driver program to test above functions +int main() +{ + int arr[] = {64, 34, 25, 12, 22, 11, 90}; + int n = sizeof(arr)/sizeof(arr[0]); + bubbleSort(arr, n); + printf("Sorted array: \n"); + printArray(arr, n); + return 0; +} From 8afc3d94bcedb7ccc5a687b26602a32b434b9b18 Mon Sep 17 00:00:00 2001 From: Luke Oliff Date: Mon, 8 Oct 2018 17:47:38 +0100 Subject: [PATCH 2/2] Rename hactoberfest_noob to code/ashish010598.cpp --- hactoberfest_noob => code/ashish010598.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename hactoberfest_noob => code/ashish010598.cpp (100%) diff --git a/hactoberfest_noob b/code/ashish010598.cpp similarity index 100% rename from hactoberfest_noob rename to code/ashish010598.cpp