venerdì 22 gennaio 2010

(44) Fast Bit Counting Routines

(44) Fast Bit Counting Routines: "A common problem asked in job interviews is to count the number of 1-bits in an unsigned integer. This article presents six solutions to this problem. Source code in C is available.





1) Iterated Count
int bitcount (unsigned int n) {
int count = 0;
while (n) [...]"

Nessun commento:

Posta un commento

Nota. Solo i membri di questo blog possono postare un commento.