How could i access data which is being stored using Z-order with O(1) time complexity in array? I need fast access to each of element by their coordinates. I there any faster way to access this data than using while to shift bits?

One way would be using lookup tables (i have static size of data)

**EDIT:**

One idea i had right now is to store leaves in sequence using y\*SIZE+x

**EDIT 2.:**

I am storying bits in quad tree in std::bitset. I am trying to do checks if some data is available. in matrices of size 128\*128. So i can skip bruteforce matrix search for empty data.