hw4 - problem is in fact the conquer step of the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 413, Analysis of Algorithms Fall Semester, 2004 Assignment 4: Divide-and-Conquer and Sorting Due Date : Oct. 8, 2004 (at the beginning of CSE 413 class) 1. For two distinct points p 1 =( x 1 ,y 1 )and p 2 =( x 2 ,y 2 ) in the plane, we say that p 1 dominates p 2 if x 1 x 2 and y 1 y 2 . Given a set P = { p 1 ,p 2 ,...,p n } of n points in the plane, a point p i P is called a maximal point in P if p i is not dominated by any other point in P . Assume that P is not given in any sorted order. Design an O ( n log n ) time algorithm based on the divide-and-conquer strategy for computing all maximal points in P . (20 points) Note : 0 points will be given for this problem if the solution algorithm is not based on the divide-and-conquer strategy. 2. In this exercise, you are asked to complete the solution for the skyline problem in pages 102-104 of the textbook. More speci±cally, you are to solve the following problem in O ( n ) time: Given two skylines of size n each, “merge” them to produce an output skyline. (This
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: problem is in fact the conquer step of the divide-and-conquer algorithm for the skyline problem in the textbook.) You may consider using the plane sweeping technique discussed in class. ( 20 points ) 3. Exercise 5.11, page 115. ( 20 points ) 4. Read Chap. 6.4.1 and do Exercise 6.27, page 178. ( 20 points ) Hint : You may consider the following idea. Suppose the maximum string length is k . You may let your algorithm consist of k sorting stages . At the i-th stage (which performs sorting based on the i-th digits of the strings), only those strings whose lengths are at least i actually participate in the sorting of this stage. What will be the sequence of sorting stages that you use? How would you make this idea work (if you like to play with this idea)? Total Points : 80...
View Full Document

Ask a homework question - tutors are online