Heaps

Algorithms

The Skyline Problem

A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Suppose you are given the locations and height of all the buildings in a cityscape. Write a program to output the skyline formed by these buildings.

Read
Algorithms

Trapping Rain Water (2D)

Given an n x m matrix of positive integers representing the height of each cell in a 2D elevation map, compute the amount of water that can be trapped within it.

Read