Suppose we write the following Comparator:
import structure5.*;
import java.util.Iterator;
import java.util.Comparator;
import java.util.Scanner;
{
base = baseCompare;
}
public int compare(T a, T b)
return -base.compare(a,b);
What happens when we construct:
Scanner s = new Scanner(System.in);
while (s.hasNextInt())
v.add(s.nextInt());
v.sort(c);
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here