One embodiment in accordance with the invention is a method for enabling
efficient data storage. The method can include determining a maximum
value for an element of a data structure, wherein the element can be
stored. Also, a minimal bit number is determined that can represent the
maximum value. A minimum amount of memory is determined for storing the
minimal bit number. The minimum amount of memory is allocated. A
determination is made as to where to store the element within the minimum
amount of allocated memory.