NAMES:

LOGINS:

PRECEPT:

COS 226 Exercises on Sorting


1. Which, if any, of the following programs from the textbook are stable: selection (Program 6.12), insertion (Program 6.13), or bubblesort (Program 6.14)?



















2. Given an array of N points, with integer x and y coordinates (say, 64-bits), describe an efficient algorithm to identify and remove all duplicates. Your algorithm should run in O(N log N) time in the worst case. Give a crisp and concise English description of your algorithm - don't write Java code.