/SkyLineProblem

Sky Line Problem implementation in Java

Primary LanguageJava

The Skyline Problem

From a distance, the view of a collection of high-rise buildings reveals a profile. With sufficient simplifications, this observation turns into a problem called the skyline problem. The objective is to find the profile created by the roofs of the buildings. The simplifications are: All of the buildings are represented by rectangles and the profile is on 2D plane

data.txt

  • This file holds information about rectangles. Each line is related with a rectangle.

  • Fields are all integers

  • Fields are separated with spaces

  • Format:

    width height position
    width height position
    width height position
    .
    .
    .
    
  • Example:

    3 9 17
    5 9 9 
    12 4 8 
    3 11 3 
    10 7 1 
    2 3 19
    

Output

  • List all the corners of the skyline in the standard output.
  • Make sure it is ordered. (i.e. when followed, creates a path of the skyline)
  • Example:

(1, 0), (1, 7), (3, 7), (3, 11), (6, 11), (6, 7), (9, 7), (9, 9), (14, 9), (14, 4), (17, 4), (17, 9), (20, 9), (20, 3), (21, 3), (21, 0)