Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
Worauf beziehst du dich denn? Quelle?Warum ist das Comparator-Interface für solche Algorithmen unverzichtbar?
public static List<String> sortStringsLexicographicallyDescending(List<String> list) {
if (list.size() < 2) {
return list;
}
List<String> less = new ArrayList<String>();
List<String> greater = new ArrayList<String>();
String pivot = list.get(0);
for (int i = 1;i < list.size();i++) {
if (pivot.compareTo(list.get(i)) < 1) {
greater.add(list.get(i));
} else {
less.add(list.get(i));
}
}
return sortStringsLexicographicallyDescending(less).add(pivot).addAll(sortStringsLexicographicallyDescending(greater));
}