I need to store a large number of Long
values in a SortedSet
implementation in a space-efficient manner. I was considering bit-set implementations and discovered Javaewah. However, the API expects int
values rather than long
s.
Can anyone recommend any alternatives or suggest a good way to solve this problem? I am mainly concerned with space efficiency. Upon building the set I will need to access the minimum and maximum element once. However, access time is not a huge concern (i.e. so a fully run-length encoded implementation will be fine).
EDIT
I should be clear that the implementation does not have to implement the SortedSet
interface providing I can access the minimum and maximum elements of the collection.