Add Slow Sort (#2546) (#2547)

This commit is contained in:
Amir
2021-10-13 06:54:55 +02:00
committed by GitHub
parent ee3f82007a
commit b83bb0178d
2 changed files with 60 additions and 0 deletions

View File

@@ -46,6 +46,17 @@ final class SortUtils {
return v.compareTo(w) > 0;
}
/**
* This method checks if first element is greater than or equal the other element
*
* @param v first element
* @param w second element
* @return true if the first element is greater than or equal the second element
*/
static <T extends Comparable<T>> boolean greaterOrEqual(T v, T w) {
return v.compareTo(w) >= 0;
}
/**
* Prints a list
*