Table of Contents

Brian Kernighan’s Algorithm for Counting Set Bits

Counts the number of set bits in an integer by repeatedly stripping away the rightmost set bit.

Category: bit-manipulation
Loading...

Enjoy reading code with a tandem explainer?

Explain code with DocComment! Try out your own code!

Try DocComment