From 79ac8d4cc1ac0e3355c0b38966b975b93a540e34 Mon Sep 17 00:00:00 2001 From: cripttion <77504107+cripttion@users.noreply.github.com> Date: Wed, 18 Oct 2023 22:06:24 +0530 Subject: [PATCH] Add files via upload --- Java/sorting techniques/Bubble.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Java/sorting techniques/Bubble.java diff --git a/Java/sorting techniques/Bubble.java b/Java/sorting techniques/Bubble.java new file mode 100644 index 00000000..93c07484 --- /dev/null +++ b/Java/sorting techniques/Bubble.java @@ -0,0 +1,24 @@ + + +public class Bubble { + public static void main(String[] args) { + int []arr = {4,5,1,2,3}; + int n = arr.length; + for(int i = 0;iarr[j+1]) + { + arr[j] = arr[j]^arr[j+1]; + arr[j+1]=arr[j]^arr[j+1]; + arr[j] = arr[j]^arr[j+1]; + } + } + } + for(int xx:arr) + { + System.out.print(xx+" "); + } + } +}