our first challenge. So to make a long story short let's start with the problem description."You are to design a program to assist an architect in drawing the skyline of a city given the locations of the buildings in the city. To make the problem tractable, all buildings are rectangular in shape and they share a common bottom. A building is specified by a triple (left and right coordinate and the height)...In the diagram above buildings are shown on the left and the skyline is shown on the right..."
To sum up, you are given a list of the buildings and your task is to find the skyline (so that you can tell what is the highest point for every location in the city). What is more, the performance of your solution should be O(n log n).

Brak komentarzy:
Prześlij komentarz