variable length bit array
Posted on 2002-07-23
what would be the best way to implement an array of bits in variable length (sometimes larger than 64 bits). I need to be able to get the bits between a given index to a given index in the minimal time.
If I use array of int or long then extracting a set of bits which are partly in one int and partly in another requires more advanced operation.
The data strucure used must be extremely efficient in space consumption as well as the time complexity of the extraction of bits from index to index.