Answered step by step
Verified Expert Solution
Question
1 Approved Answer
New York has been determined as the country with the highest number of skyscrapers in the world, with 1 , 5 1 8 skyscrapers it
New York has been determined as the country with the highest number of skyscrapers in the world, with skyscrapers it had in In a city where skyscrapers and the number of buildings are abundant, manually drawing the city's silhouette is challenging for city planners. For this reason, a competition has been organized to design an algorithm capable of extracting the skyline of the city when provided with the locations and heights of all buildings that appear in the New York City landscape photograph.
The following information is needed for this competition:
It is assumed that all buildings are located on the xaxis y that is they share the common base, and each structure is represented by a triple in the form of left, height, right.
A silhouette is a collection of rectangular strips.
A rectangular strip is represented as a pair left height where left is the xcoordinate of the left side of strip and height is the height of the strip.
An example is as follows:
Input: Array of buildings
Output: Silhoutte an array of rectangular strips
A strip has x coordinate of left side and height
For this competition, design a divide and conquer algorithm that solves the problem and calculate the time complexity of the algorithm.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started