From a30985e43f0a1a04d4a52c7c5b8fd34fc712e708 Mon Sep 17 00:00:00 2001 From: Anushka2600 <50695970+Anushka2600@users.noreply.github.com> Date: Sat, 18 May 2019 17:17:01 +0530 Subject: [PATCH 1/9] bubble sort task V --- bubble sort task V2.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 bubble sort task V2.md diff --git a/bubble sort task V2.md b/bubble sort task V2.md new file mode 100644 index 0000000..6e0545e --- /dev/null +++ b/bubble sort task V2.md @@ -0,0 +1,35 @@ +// Bubble sort +import java.util.*; + +public class Solution { + + public static void main(String[] args) { + // Initialize arr + int arr[] = { 10, 7, 3, 1, 9, 7, 4, 3 }; + System.out.print("Initial Array : "); + printArray(arr); + bubbleSort(arr); + } + public static void printArray(int[] arr) { + for(int i = 0; i < arr.length; i++) { + System.out.print(arr[i] + " "); + } + + System.out.println(); + } + static void bubbleSort(int[] arr) { + for (int i = 0; i < arr.length; i++) { + for (int j = 0; j < arr.length - i - 1; j++) { + if (arr[j] > arr[j + 1]) { + int temp = arr[j]; + arr[j] = arr[j + 1]; + arr[j + 1] = temp; + } + } + + System.out.print("After pass " + i + " : "); + //Printing array after pass + printArray(arr); + } + } +} \ No newline at end of file From 4a12eaa5a6569603fd9240b2e25af3f29ce6692a Mon Sep 17 00:00:00 2001 From: Anushka2600 <50695970+Anushka2600@users.noreply.github.com> Date: Mon, 20 May 2019 20:16:36 +0530 Subject: [PATCH 2/9] Delete bubble sort task V2.md --- bubble sort task V2.md | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 bubble sort task V2.md diff --git a/bubble sort task V2.md b/bubble sort task V2.md deleted file mode 100644 index 6e0545e..0000000 --- a/bubble sort task V2.md +++ /dev/null @@ -1,35 +0,0 @@ -// Bubble sort -import java.util.*; - -public class Solution { - - public static void main(String[] args) { - // Initialize arr - int arr[] = { 10, 7, 3, 1, 9, 7, 4, 3 }; - System.out.print("Initial Array : "); - printArray(arr); - bubbleSort(arr); - } - public static void printArray(int[] arr) { - for(int i = 0; i < arr.length; i++) { - System.out.print(arr[i] + " "); - } - - System.out.println(); - } - static void bubbleSort(int[] arr) { - for (int i = 0; i < arr.length; i++) { - for (int j = 0; j < arr.length - i - 1; j++) { - if (arr[j] > arr[j + 1]) { - int temp = arr[j]; - arr[j] = arr[j + 1]; - arr[j + 1] = temp; - } - } - - System.out.print("After pass " + i + " : "); - //Printing array after pass - printArray(arr); - } - } -} \ No newline at end of file From 8f4e4b29e260103c56ea926318853cbd84dc884c Mon Sep 17 00:00:00 2001 From: Anushka2600 <50695970+Anushka2600@users.noreply.github.com> Date: Mon, 20 May 2019 20:22:16 +0530 Subject: [PATCH 3/9] Create new-file.md --- new-file.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 new-file.md diff --git a/new-file.md b/new-file.md new file mode 100644 index 0000000..e52a764 --- /dev/null +++ b/new-file.md @@ -0,0 +1,5 @@ +### Inductions-Task0 + +#### Task_v2.0 + +#### Code for Bubble Sort From 00923aa588e651f2a9731cbe1cc1a2614435392a Mon Sep 17 00:00:00 2001 From: Anushka2600 <50695970+Anushka2600@users.noreply.github.com> Date: Mon, 20 May 2019 20:34:40 +0530 Subject: [PATCH 4/9] Delete new-file.md --- new-file.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 new-file.md diff --git a/new-file.md b/new-file.md deleted file mode 100644 index e52a764..0000000 --- a/new-file.md +++ /dev/null @@ -1,5 +0,0 @@ -### Inductions-Task0 - -#### Task_v2.0 - -#### Code for Bubble Sort From 2e9738b5b4481886368de070b10e4bcecb74baa3 Mon Sep 17 00:00:00 2001 From: Anushka2600 <50695970+Anushka2600@users.noreply.github.com> Date: Mon, 20 May 2019 20:35:12 +0530 Subject: [PATCH 5/9] Create Bubble_Sort.md --- Bubble_Sort.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Bubble_Sort.md diff --git a/Bubble_Sort.md b/Bubble_Sort.md new file mode 100644 index 0000000..e52a764 --- /dev/null +++ b/Bubble_Sort.md @@ -0,0 +1,5 @@ +### Inductions-Task0 + +#### Task_v2.0 + +#### Code for Bubble Sort From 9c2575bfc5cfabb11ce0c793c70d24a0a035cb81 Mon Sep 17 00:00:00 2001 From: Anushka2600 <50695970+Anushka2600@users.noreply.github.com> Date: Mon, 20 May 2019 21:24:55 +0530 Subject: [PATCH 6/9] bubble_sort --- bubble_sort.java | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 bubble_sort.java diff --git a/bubble_sort.java b/bubble_sort.java new file mode 100644 index 0000000..37a7f08 --- /dev/null +++ b/bubble_sort.java @@ -0,0 +1,35 @@ +// Bubble sort +import java.util.*; + +public class Solution { + + public static void main(String[] args) { + // Initialize arr + int arr[] = { 10, 7, 3, 1, 9, 7, 4, 3 }; + System.out.print("Initial Array : "); + printArray(arr); + bubbleSort(arr); + } + public static void printArray(int[] arr) { + for(int i = 0; i < arr.length; i++) { + System.out.print(arr[i] + " "); + } + + System.out.println(); + } + static void bubbleSort(int[] arr) { + for (int i = 0; i < arr.length; i++) { + for (int j = 0; j < arr.length - i - 1; j++) { + if (arr[j] > arr[j + 1]) { + int temp = arr[j]; + arr[j] = arr[j + 1]; + arr[j + 1] = temp; + } + } + + System.out.print("After pass " + i + " : "); + //Printing array after pass + printArray(arr); + } + } +} From 41dbaf1d7bfddc4595fc2dd714c7a5222247a6ca Mon Sep 17 00:00:00 2001 From: Anushka2600 <50695970+Anushka2600@users.noreply.github.com> Date: Mon, 20 May 2019 21:26:06 +0530 Subject: [PATCH 7/9] Delete Bubble_Sort.md --- Bubble_Sort.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 Bubble_Sort.md diff --git a/Bubble_Sort.md b/Bubble_Sort.md deleted file mode 100644 index e52a764..0000000 --- a/Bubble_Sort.md +++ /dev/null @@ -1,5 +0,0 @@ -### Inductions-Task0 - -#### Task_v2.0 - -#### Code for Bubble Sort From 7b627c9bdeb61772e8f6b84cb47497fcbb903abc Mon Sep 17 00:00:00 2001 From: Anushka2600 <50695970+Anushka2600@users.noreply.github.com> Date: Mon, 20 May 2019 21:45:53 +0530 Subject: [PATCH 8/9] Update bubble_sort.java --- bubble_sort.java | 60 ++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/bubble_sort.java b/bubble_sort.java index 37a7f08..9b73dfd 100644 --- a/bubble_sort.java +++ b/bubble_sort.java @@ -1,35 +1,39 @@ -// Bubble sort -import java.util.*; -public class Solution { +import java.util.*; +public class Solution +{ + public static void main(String[] args) + { + int arr[] = { 10, 7, 3, 1, 9, 7, 4, 3 }; + System.out.print("Initial Array : "); + printArray(arr); + bubbleSort(arr); + } + public static void printArray(int[] arr) + { + for(int m = 0; m < arr.length; m++) + { + System.out.print(arr[m] + " "); + } - public static void main(String[] args) { - // Initialize arr - int arr[] = { 10, 7, 3, 1, 9, 7, 4, 3 }; - System.out.print("Initial Array : "); - printArray(arr); - bubbleSort(arr); + System.out.println(); } - public static void printArray(int[] arr) { - for(int i = 0; i < arr.length; i++) { - System.out.print(arr[i] + " "); + static void bubbleSort(int[] arr) + { + for (int m = 0; m < arr.length; m++) + { + for (int n = 0; n < arr.length - m - 1; n++) + { + if (arr[n] > arr[n + 1]) + { + int temp = arr[n]; + arr[n] = arr[n + 1]; + arr[n + 1] = temp; + } } - System.out.println(); + System.out.print("After pass " + m + " : "); + printArray(arr); + } } - static void bubbleSort(int[] arr) { - for (int i = 0; i < arr.length; i++) { - for (int j = 0; j < arr.length - i - 1; j++) { - if (arr[j] > arr[j + 1]) { - int temp = arr[j]; - arr[j] = arr[j + 1]; - arr[j + 1] = temp; - } - } - - System.out.print("After pass " + i + " : "); - //Printing array after pass - printArray(arr); - } } -} From e51eeaa85be55ac38c7528cea08af23a57b90313 Mon Sep 17 00:00:00 2001 From: Anushka2600 <50695970+Anushka2600@users.noreply.github.com> Date: Tue, 21 May 2019 23:19:40 +0530 Subject: [PATCH 9/9] Delete README.md --- README.md | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index ba46601..0000000 --- a/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Inductions-Task0 -Repository for the Task-0 v2 of the Spider Webdev Inductions - -## Task_v2.0 - -Follow these to complete this subtask - -The basic idea of this task is to understand how collaborated projects work on github - - Fork this repo - - Clone the forked repo to your local system - - Implement a given algorithm in your favourite programming language and commit - - Push the file to the repository - - Make sure you pull the code using `git pull` before pushing your code - - After pushing the code, give a pull request or a PR to the parent repo from which you have forked from - - Your pull request will then be reviewed by the mentor