NAMES:

LOGINS:

PRECEPTS:

COS 226 Exercises on Mergesort

Reference: Section 2.2 in Algorithms, 4th edition


1. Show, in the style of the trace of Algorithm 2.4 (p. 180), the result of using mergesort to sort the keys:

E A S Y T O M E R G E S O R T















2. Given an array of N points, with integer x- and y-coordinates (say, 64-bits each), describe a linearithmic algorithm to identify and remove all duplicates. Give a crisp and concise English description of your algorithm—don't write Java code.