diff --git a/bubblesort b/bubblesort new file mode 100644 index 0000000..052f4fb --- /dev/null +++ b/bubblesort @@ -0,0 +1,38 @@ +public class bubblesort{ + + public static void main(String[] args) { + // TODO Auto-generated method stub + int[] arr= {10,99,100,50,83}; + + bubblesort(arr); + + + } + + public static void bubblesort(int[] arr) { + int newtemp=0; + + for(int i=0;iarr[j+1]) + { + newtemp=arr[j]; + arr[j]=arr[j+1]; + arr[j+1]=newtemp; + + } + + } + } + for(int k=0;k<=4;k++) + { + System.out.print(arr[k]+" "); + } + } + +} + + +