News for hackers. Stuff that matters.
Re:The skyline problem by prawks on Tuesday September 02, 2014 @11:31AM (#8258121)
This is pretty much the solution given. I've encountered a similar problem before (draw a bunch of overlapping squares with differing z-values) and done it similarly. The difficulty you end up having is that a stack doesn't give you a fast way to find the maximum height (what building/square) is on top at any given point. Hence, the article suggests a max heap.

There are no comments on this comment yet.