mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-12-19 07:00:35 +08:00
Remove duplicate SimpleSort (same logic as ExchangeSort) (#6441)
* Remove duplicate SimpleSort (same logic as ExchangeSort) * Removed test class for SimpleSort as it was also duplicate --------- Co-authored-by: Lucas G <lucasgomesm1808@gmail.com>
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
package com.thealgorithms.sorts;
|
||||
|
||||
public class SimpleSort implements SortAlgorithm {
|
||||
@Override
|
||||
public <T extends Comparable<T>> T[] sort(T[] array) {
|
||||
for (int i = 0; i < array.length; i++) {
|
||||
for (int j = i + 1; j < array.length; j++) {
|
||||
if (SortUtils.less(array[j], array[i])) {
|
||||
SortUtils.swap(array, i, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
return array;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.thealgorithms.sorts;
|
||||
|
||||
public class SimpleSortTest extends SortingAlgorithmTest {
|
||||
@Override
|
||||
SortAlgorithm getSortAlgorithm() {
|
||||
return new SimpleSort();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user