static double percentageSorted(L l) { if (l(l) < 2) ret 100; int sorted = 0; for (int i = 0; i < l(l)-1; i++) if (cmp(l.get(i), l.get(i+1)) <= 0) ++sorted; ret sorted*100.0/(l(l)-1); }