This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Fall 11: CSci 5421—Advanced Algorithms and Data Structures Sample Solution (Prepared by Ravi Janardan) This write-up illustrates what is expected by way of a solution for a problem involving the design and analysis of an algorithm (cf: Instructions for Hw1). This is meant to be illustrative only, and is not set in stone, so feel free to modify this for your purposes. The key is to generate an answer that communicates the main ideas effectively and is easy for others to understand. Problem: Let S be a set of n points, p i = ( x i ,y i ) , 1 ≤ i ≤ n , in the plane. A point p j ∈ S is a maximal point of S if there is no other point p k ∈ S such that x k ≥ x j and y k ≥ y j . The figure below illustrates the maximal points of a point-set S . Note that the maximal points form a “staircase” which descends rightwards. Maximal point Non-maximal point Give an efficient divide–and–conquer algorithm to determine the maximal points of S . Your answer should include (i) a clear description of the main ideas and the data structures used, which makes the correctness self-evident, (ii) pseudocode for the algorithm (at the level of detail...
View Full Document