Tom Anderson wrote:
> 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.

I'd use 'or' rather than 'xor'. The or operator is more likely to yield
a '1' at the end of it, and a 1 is narrower than a 0, obviously making
it more efficient to store.

-- 
Ben Sizer

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to