language agnostic - What is a fast n-dimensional Z-order curve algorithm? -
space filling curves way fill grid line preserves locality - is, 2 close points @ line 2 close points on space.
is there fast (o(1)
) algorithm map between n-dimensional coordinate , index on corresponding n-dimensional space-filling curve?
you need map n-d point interleaved binary format, going o(n), if have you're 1d sorted array have binary search o(logm) m number of points; use *hashmap < binary, index > * , change logm binary search lookup constant o(1) lookup.
Comments
Post a Comment