logoalt Hacker News

pixelpoettoday at 2:41 PM3 repliesview on HN

You can even build them with basically one line of code by sorting points using Morton / Z-curve order. It's linear time if you use a counting/radix sort.

Edit: lol, downvoted for this post. Never change, HN.


Replies

rdtsctoday at 8:04 PM

Yeah good point, they are downsides for sure but it's a simple enough approach and most of all it can be shoved in a database (or b-tree or any 1d-sorted data structure).

And for a z-curve, the order is basically a depth-first traversal of a quadtree.

quibonotoday at 3:07 PM

I'd love to see that. Could you link me to an implementation or explain this in more detail please?

show 1 reply
pavlovtoday at 3:05 PM

It’s super easy to click the downvote button by accident on mobile when you meant to upvote. And this UI will never be fixed because this is HN after all.

show 4 replies