Consider the case where you have 3-dimensional space. You want to know whether at a given point (x,y,z) in space, does anything exist(just like checking if in a 3D array at (x,y,z) is there a 1 or 0). What would be the most efficient way to perform this kind of operation keeping hardware limits in consideration(like if this operation needs to be performed on an embedded system).

I did think of direct access arrays but they would quickly run out of space, the other thing I thought was of multilevel hashing using a modified universal hash function. I would like to know other such possibilities and how would this scale to N-dimensional data.

  • 1
    $\begingroup$ This is a good question but pretty application-dependent. One option if the occupied spaces are sparse is just using a set (hash table). $\endgroup$
    – 6005
    Dec 12, 2021 at 18:05
  • $\begingroup$ Application would be something related to image processing and/or computer vision. The reason I mentioned hardware is maybe this would be needed to be a part of some robotics/electronics project $\endgroup$
    – Rinkesh P
    Dec 13, 2021 at 8:10


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.