diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..681f41a --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,116 @@ + + + + + + + +
+ + + + xmlns:android + + ^$ + + + +
+
+ + + + xmlns:.* + + ^$ + + + BY_NAME + +
+
+ + + + .*:id + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:name + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + name + + ^$ + + + +
+
+ + + + style + + ^$ + + + +
+
+ + + + .* + + ^$ + + + BY_NAME + +
+
+ + + + .* + + http://schemas.android.com/apk/res/android + + + ANDROID_ATTRIBUTE_ORDER + +
+
+ + + + .* + + .* + + + BY_NAME + +
+
+
+
+
+
\ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..0fd2ca2 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/InsertionSort-Java/InsertionSort-Java.iml b/.idea/sorting-algorithms.iml similarity index 69% rename from InsertionSort-Java/InsertionSort-Java.iml rename to .idea/sorting-algorithms.iml index c90834f..d6ebd48 100644 --- a/InsertionSort-Java/InsertionSort-Java.iml +++ b/.idea/sorting-algorithms.iml @@ -2,9 +2,7 @@ - - - + diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/BubbleSort-C/BubbleSortC b/BubbleSort-C/BubbleSortC deleted file mode 100755 index b2111f6..0000000 Binary files a/BubbleSort-C/BubbleSortC and /dev/null differ diff --git a/BubbleSort-Java/BubbleSort.java b/BubbleSort-Java/BubbleSort.java deleted file mode 100644 index 8d146c3..0000000 --- a/BubbleSort-Java/BubbleSort.java +++ /dev/null @@ -1,35 +0,0 @@ - -public class BubbleSort { - static void bubbleSort(int[] arr) { - int n = arr.length; - int temp = 0; - for(int i=0; i < n; i++){ - for(int j=1; j < (n-i); j++){ - if(arr[j-1] > arr[j]){ - temp = arr[j-1]; - arr[j-1] = arr[j]; - arr[j] = temp; - } - - } - } - - } - public static void main(String[] args) { - int arr[] ={3,60,35,2,45,320,5}; - - System.out.println("Array Before Bubble Sort"); - for(int i=0; i < arr.length; i++){ - System.out.print(arr[i] + " "); - } - System.out.println(); - - bubbleSort(arr); - - System.out.println("Array After Bubble Sort"); - for(int i=0; i < arr.length; i++){ - System.out.print(arr[i] + " "); - } - - } -} \ No newline at end of file diff --git a/Bubble Sort - C++/BubbleSort.cpp b/C++/BubbleSort.cpp similarity index 100% rename from Bubble Sort - C++/BubbleSort.cpp rename to C++/BubbleSort.cpp diff --git a/HeapSort-C++/HeapSort.cpp b/C++/HeapSort.cpp similarity index 100% rename from HeapSort-C++/HeapSort.cpp rename to C++/HeapSort.cpp diff --git a/MergeSort-C++/Merge.cpp b/C++/Merge.cpp similarity index 100% rename from MergeSort-C++/Merge.cpp rename to C++/Merge.cpp diff --git a/QwickSort-C++/QuickSort.cpp b/C++/QuickSort.cpp similarity index 100% rename from QwickSort-C++/QuickSort.cpp rename to C++/QuickSort.cpp diff --git a/ShellSort-C++/ShellSort.cpp b/C++/ShellSort.cpp similarity index 100% rename from ShellSort-C++/ShellSort.cpp rename to C++/ShellSort.cpp diff --git a/BubbleSort-C/BubbleSortC.c b/C/BubbleSort.c similarity index 100% rename from BubbleSort-C/BubbleSortC.c rename to C/BubbleSort.c diff --git a/InsertionSort.c b/C/InsertionSort.c similarity index 95% rename from InsertionSort.c rename to C/InsertionSort.c index 912e47c..fe2816c 100644 --- a/InsertionSort.c +++ b/C/InsertionSort.c @@ -1,23 +1,23 @@ -# include -int main(void) -{ - int ar[10], key, i, j; - printf ("Enter 10 numbers: \n"); - for (i=0; i<10; i++) - scanf ("%d", &ar[i]); - for (i=1; i<10; i++) - { - key = ar[i]; - j = i-1; - while (j>=0 && ar[j]>key) - { - ar[j+1] = ar[j]; - j = j-1; - } - ar[j+1] = key; - } - printf ("The Sorted array:\n"); - for (i=0; i<10; i++) - printf ("ar[%d] = %d\n", i, ar[i]); - return 0; -} +# include +int main(void) +{ + int ar[10], key, i, j; + printf ("Enter 10 numbers: \n"); + for (i=0; i<10; i++) + scanf ("%d", &ar[i]); + for (i=1; i<10; i++) + { + key = ar[i]; + j = i-1; + while (j>=0 && ar[j]>key) + { + ar[j+1] = ar[j]; + j = j-1; + } + ar[j+1] = key; + } + printf ("The Sorted array:\n"); + for (i=0; i<10; i++) + printf ("ar[%d] = %d\n", i, ar[i]); + return 0; +} diff --git a/QuickSort-C.c b/C/QuickSort.c similarity index 100% rename from QuickSort-C.c rename to C/QuickSort.c diff --git a/SelectionSort.c b/C/SelectionSort.c similarity index 95% rename from SelectionSort.c rename to C/SelectionSort.c index 76a96e4..dd61bf4 100644 --- a/SelectionSort.c +++ b/C/SelectionSort.c @@ -1,30 +1,30 @@ -# include -#define MAX 1000 -int main(void) -{ - int i, j, N, pos, temp; - int ar[MAX]; - printf ("Enter the number of integers to sort:"); - scanf ("%d", &N); - printf ("Enter the integers: \n"); - for (i=0; i +#define MAX 1000 +int main(void) +{ + int i, j, N, pos, temp; + int ar[MAX]; + printf ("Enter the number of integers to sort:"); + scanf ("%d", &N); + printf ("Enter the integers: \n"); + for (i=0; i