NAME:

LOGIN:

PRECEPT:

COS 226 Exercises on Sorting


1. [Exercise 7.2, modified] Show how the file 1 0 0 1 1 1 0 0 0 0 0 1 0 1 0 0 is partitioned using Program 7.2.
















2. Given a list of N points, with integer x and y coordinates (say, 64-bits), design an efficient algorithm to identify and remove all duplicates. Your algorithm should run in O(N log N) time in the worst case.