From 021ec32b94c9d5045f56eaeb67d9597551c6a7c8 Mon Sep 17 00:00:00 2001 From: Suresh Maidaragi Date: Thu, 16 Apr 2020 18:13:47 +0530 Subject: [PATCH] Avoid looping already sorted element It is not necessary to sort already sorted element --- src/sort/BubbleSort.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sort/BubbleSort.java b/src/sort/BubbleSort.java index 6becbd3..d5d9c3a 100644 --- a/src/sort/BubbleSort.java +++ b/src/sort/BubbleSort.java @@ -16,7 +16,7 @@ public static int[] bubbleSort(int[] arr) { for(int i=0; i