3 ms·
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 simi
by prawks 12y ago
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.