Skip to content

Commit f2d1157

Browse files
authored
Merge pull request #139 from gauravdarbhanga/patch-1
Comments BubbleSort.java
2 parents ed855d6 + 16f2fc1 commit f2d1157

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/com/jwetherell/algorithms/sorts/BubbleSort.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
public class BubbleSort<T extends Comparable<T>> {
2222

2323
private BubbleSort() { }
24-
24+
//@param unsorted array
25+
//@return sorted array
2526
public static <T extends Comparable<T>> T[] sort(T[] unsorted) {
2627
boolean swapped = true;
2728
int length = unsorted.length;
@@ -37,7 +38,7 @@ public static <T extends Comparable<T>> T[] sort(T[] unsorted) {
3738
}
3839
return unsorted;
3940
}
40-
41+
//swapping the value
4142
private static <T extends Comparable<T>> void swap(int index1, int index2, T[] unsorted) {
4243
T value = unsorted[index1];
4344
unsorted[index1] = unsorted[index2];

0 commit comments

Comments
 (0)