We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5227629 + ed53bd0 commit 3551433Copy full SHA for 3551433
src/main/java/com/sorts/BubbleSort.java
@@ -1,12 +1,16 @@
1
package src.main.java.com.sorts;
2
3
-public class BubbleSort {
+import src.main.java.com.types.Sort;
4
+
5
+public class BubbleSort<T> implements Sort<T> {
6
/**
7
* This method implements the Generic Bubble Sort
8
*
9
* @param array The array to be sorted
10
* Sorts the array in increasing order
11
**/
12
13
+ @Override
14
public <T extends Comparable<T>> T[] sort(T[] array) {
15
int last = array.length;
16
//Sorting
src/main/java/com/types/Sort.java
@@ -0,0 +1,7 @@
+package src.main.java.com.types;
+@FunctionalInterface
+public interface Sort<T> {
+ public <T extends Comparable<T>> T[] sort(T[] array);
+}
0 commit comments