3 ms·
Who's answer is wrong? Cause no-one suggested a 16bit lookup table. His answer was to look at 64 bits at a time and do a [0] Kernighan style count. The "corr
by spott 10y ago
Who's answer is wrong? Cause no-one suggested a 16bit lookup table.
His answer was to look at 64 bits at a time and do a [0] Kernighan style count. The "correct" answer was an 8-bit lookup table. Which is right is going to be highly dependent on the data and the architecture you are using.
[0] http://stackoverflow.com/questions/12380478/bits-counting-algorithm-brian-kernighan-in-an-integer-time-complexity http://stackoverflow.com/questions/12380478/bits-counting-al...
- powera 10y agoYou're correct, I misread what he said the recruiter's answer was.