NAMES:

LOGINS:

PRECEPTS:

COS 226 Exercises on Mergesort

References: Section 3.2 in Algorithms, 4th edition


1. Show, in the style of the trace of Algorithm 3.4 (p. 237), 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 that to identify and remove all duplicates. Give a crisp and concise English description of your algorithm—don't write Java code.