Monthly Archives: September 2014

Fastest bit counting

The best bit counting algorithm as far as I know is the one invented by folks at Stanford University, which is always O(1). int bitcount(int n){    int cnt = 0;    n = n – ((n >> 1) & … Continue reading

Posted in Uncategorized | Leave a comment