gakhov / pdsa

Probabilistic Data Structures and Algorithms in Python
http://pdsa.readthedocs.io
MIT License
121 stars 19 forks source link

Implement a BitVector for memory better usage #2

Closed gakhov closed 7 years ago

gakhov commented 7 years ago

Problem with the bint (or bool) arrays that that in C++ use byte as a minimal memory unit for type definitions (so, bool means not just 0/1, but smth. like 0/non-0).

We can encode in such byte additional information by using all its 8 bits separately. This is an idea of BitVector - array of such chunks by 8 bits (1 byte), called here BitField.