Answered step by step
Verified Expert Solution
Link Copied!

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 1,518 skyscrapers it had in 2019. 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:
1.It is assumed that all buildings are located on the x-axis (y =0), that is, they share the common base, and each structure is represented by a triple in the form of left, height, right.
2. A silhouette is a collection of rectangular strips.
A rectangular strip is represented as a pair (left, height), where left is the x-coordinate of the left side of strip and height is the height of the strip.
An example is as follows:
Input: Array of buildings
{(1,11,5),(2,6,7),(3,13,9),(12,7,16),(14,3,25),(19,18,22),(23,13,29),(24,4,28)}
Output: Silhoutte (an array of rectangular strips)
A strip has x coordinate of left side and height
{(1,11),(3,13),(9,0),(12,7),(16,3),(19,18),(22,3),(23,13),(29,0)}
For this competition, design a divide and conquer algorithm that solves the problem and calculate the time complexity of the algorithm.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Describe the three sections of a cash budget.

Answered: 1 week ago

Question

understand the key issues concerning international assignments

Answered: 1 week ago