On Wed, 2 Nov 2005, Dan Bishop wrote:

Tor Erik Sønvisen wrote:

I need a time and space efficient way of storing up to 6 million bits.

The most space-efficient way of storing bits is to use the bitwise
operators on an array of bytes:

Actually, no, it's to xor all the bits together and store them in a single
boolean.

Getting them back out is kinda tricky though.

Time efficency is more important then space efficency

In that case, you're better off simply using a list of bools.

Unlikely - the indexing is a bit simpler, but the cache hit rate is going to go through the floor.

tom

--
power to the people and the beats
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to