From c924184fa49873d0bdae824a902701f5ee8452ac Mon Sep 17 00:00:00 2001 From: guptakhyati <44610158+guptakhyati@users.noreply.github.com> Date: Thu, 10 Oct 2019 19:49:26 +0530 Subject: [PATCH] Create BubbleSort --- BubbleSort | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 BubbleSort diff --git a/BubbleSort b/BubbleSort new file mode 100644 index 0000000..68dd18c --- /dev/null +++ b/BubbleSort @@ -0,0 +1,26 @@ +import java.util.Scanner; +public class bubblesort { + public static void main(String[] args) { + Scanner s=new Scanner(System.in); + int n=s.nextInt(); + int[] arr=new int[n]; + for (int i = 0; i arr[j+1]){ + int temp=arr[j]; + arr[j]=arr[j+1]; + arr[j+1]=temp; + } + } + } + for (int k = 0; k