📅  最后修改于: 2022-03-11 14:58:17.989000             🧑  作者: Mango
public static T maximalElement (List list, int from, int to) {
T max = list.get(from);
for (int i = from + 1; i < to; i++) {
T elem1 = list.get(i);
if (elem1.compareTo(max) > 0) {
max = elem1;
}
}
return max;
}