use of edu.princeton.cs.algs4.Counter in project algorithms-sedgewick-wayne by reneargento.
the class Exercise9 method main.
public static void main(String[] args) {
int[] whitelist = { 2, 10, 3, 6, 5, 4, 7, 1, 9, 8 };
int[] keys = { 10, 12, 5 };
Counter counter = new Counter("Operations");
Arrays.sort(whitelist);
for (int i = 0; i < keys.length; i++) {
if (rank(keys[i], whitelist, counter) == -1) {
StdOut.println(keys[i]);
}
}
StdOut.println(counter);
}
Aggregations