Monday, August 15, 2011

An efficient algorithm to find the no. of 1's in a binary number of fixed length?

There is a fantastic page that shows all the best known tricky things you can do with bit fiddling. Counting bits among them, refer to [1] and be amazed. There's a few algorithms, so make sure you read past the naive one.

No comments:

Post a Comment