Skip to content

Commit d07e668

Browse files
Fixed <T> parameter error in SelectionSort
1 parent 5150a6b commit d07e668

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sorts/SelectionSort.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ public class SelectionSort implements SortAlgorithm {
1010

1111
/**
1212
* This method swaps the two elements in the array
13+
* @param <T>
1314
* @param arr, i, j The array for the swap and
1415
the indexes of the to-swap elements
1516
*/
16-
public void swap(T[] arr, int i, int j) {
17+
18+
public <T> void swap(T[] arr, int i, int j) {
1719
T temp = arr[i];
1820
arr[i] = arr[j];
1921
arr[j] = temp;

0 commit comments

Comments
 (0)