From 6d3096eed9f5da50fa8c724de01ec862f2f5275e Mon Sep 17 00:00:00 2001
From: pasanjayawickrama <pasan.super@gmail.com>
Date: Sun, 13 Oct 2019 17:29:53 +0530
Subject: [PATCH 1/2] Added Bubble sort

---
 Sorting Algorithms/BubbleSort.java | 33 ++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 Sorting Algorithms/BubbleSort.java

diff --git a/Sorting Algorithms/BubbleSort.java b/Sorting Algorithms/BubbleSort.java
new file mode 100644
index 0000000..c890c16
--- /dev/null
+++ b/Sorting Algorithms/BubbleSort.java	
@@ -0,0 +1,33 @@
+public class BubbleSort {
+    public static void BubbleSort( int [ ] no )
+    {
+        int j;
+        boolean flag = true;
+        int temp;
+
+        while ( flag )
+        {
+            flag= false;
+            for( j=0;  j < no.length -1;  j++ )
+            {
+                if ( no[ j ] < no[j+1] )
+                {
+                    temp = no[ j ];
+                    no[ j ] = no[ j+1 ];
+                    no[ j+1 ] = temp;
+                    flag = true;
+                }
+            }
+        }
+
+        for(int p = 0 ;p<no.length;p++)
+        {
+            System.out.println(" "+no[p]);
+        }
+    }
+
+    public static void main(String[] args) {
+        int[] no = {10,20,30,70,90,02,03,05,65,72,23};
+        BubbleSort(no);
+    }
+}

From 07d9437b2622b5fa70cee0df8845b515ad9d2aa5 Mon Sep 17 00:00:00 2001
From: pasanjayawickrama <pasan.super@gmail.com>
Date: Sun, 13 Oct 2019 17:38:25 +0530
Subject: [PATCH 2/2] Added Bucket Sort

---
 Sorting Algorithms/BucketSort.java | 34 ++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 Sorting Algorithms/BucketSort.java

diff --git a/Sorting Algorithms/BucketSort.java b/Sorting Algorithms/BucketSort.java
new file mode 100644
index 0000000..fd76474
--- /dev/null
+++ b/Sorting Algorithms/BucketSort.java	
@@ -0,0 +1,34 @@
+import java.util.*;
+ 
+public class BucketSort{
+ 
+   public static void sort(int[] a, int maxVal) {
+      int [] bucket=new int[maxVal+1];
+ 
+      for (int i=0; i<bucket.length; i++) {
+         bucket[i]=0;
+      }
+ 
+      for (int i=0; i<a.length; i++) {
+         bucket[a[i]]++;
+      }
+ 
+      int outPos=0;
+      for (int i=0; i<bucket.length; i++) {
+         for (int j=0; j<bucket[i]; j++) {
+            a[outPos++]=i;
+         }
+      }
+   }
+ 
+ 
+   public static void main(String[] args) {
+      int maxVal=5;
+      int [] data= {5,3,0,2,4,1,0,5,2,3,1,4}; 
+ 
+      System.out.println("Before: " + Arrays.toString(data));
+      sort(data,maxVal);
+      System.out.println("After:  " + Arrays.toString(data));
+   }
+}
+ 
\ No newline at end of file