Please help me to solve this algorithm into java source code

Please help me to solve this algorithm into java source code(Algorithm)

Give the information of n buildings (L,R,H)
which are the left position, right position,
and the height of the building, respectively.
Find the skyline position of the n buildings in
the form (position along x-axis, height,
position along x-axis, height, …)
Ex: Give 3 buildings with (5,6,8), (7,11,9),
(2,13,4), the answer is (1, 13, 4, 0, 5, 6, 7, 11, 9,
0)

Solution

The output should consist of the vector that describes the skyline. In the skyline vector (v1, v2, v3, ... vn) , the vi such that i is an even number represent a horizontal line (height). The vi such that i is an odd number represent a vertical line (x-coordinate).

Below is the required code snippest :

Thank you.

Please help me to solve this algorithm into java source code(Algorithm) Give the information of n buildings (L,R,H) which are the left position, right position,

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site