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

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

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
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

## This note was uploaded on 01/06/2012 for the course MANAGEMENT 000 taught by Professor 游啟璋 during the Spring '11 term at National Taiwan University.

Ask a homework question - tutors are online
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}