Re:Building data structures that are smaller than an array a...
by gorset on Wednesday February 29, 2012 @11:43PM
(#3650957)
You also get order with a wavelet tree. You can ask "Give me the absolute position for the 4th value 42 in the array". By using a wavelet tree with an index, you can answer that question in almost constant time.
access: O(1)
seek: O(1)
Problem solved!
:)
edit: I'm missing the "Use less memory than an array in all circumstances" requirement, but hey, you talk about "billion of records" in your post.