// sort in Java // library (Collections) version written Jan 00 by Ulrich Stern //** This copy courtesy of http://verify.stanford.edu/uli/java_cpp.html //** Added Timer() code import java.util.*; public class udasort { static class Range { int lb; int ub; Range(int l, int u) { lb = l; ub = u; } public String toString() { return "[" + lb + "," + ub + "]"; } } // compare lower bound static class LBComparator implements Comparator { public int compare(Object o1, Object o2) { return ((Range)o1).lb - ((Range)o2).lb; } } // compare upper bound static class UBComparator implements Comparator { public int compare(Object o1, Object o2) { return ((Range)o1).ub - ((Range)o2).ub; } } public static void main(String[] args) { int N = Integer.parseInt(args[0]); long start = System.currentTimeMillis(); List a = new ArrayList(N); for (int i=0; i