mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-09 20:20:56 +08:00
Fixed <T> parameter error in SelectionSort
This commit is contained in:
@ -10,10 +10,12 @@ public class SelectionSort implements SortAlgorithm {
|
||||
|
||||
/**
|
||||
* This method swaps the two elements in the array
|
||||
* @param <T>
|
||||
* @param arr, i, j The array for the swap and
|
||||
the indexes of the to-swap elements
|
||||
*/
|
||||
public void swap(T[] arr, int i, int j) {
|
||||
|
||||
public <T> void swap(T[] arr, int i, int j) {
|
||||
T temp = arr[i];
|
||||
arr[i] = arr[j];
|
||||
arr[j] = temp;
|
||||
|
Reference in New Issue
Block a user