Algorithm Search⌘K

Algorithmintro

Kernighan's bit count

Also called Brian Kernighan's method, clear lowest set bit loop.

Repeatedly clears the lowest set bit with x &= x-1, so it runs in time proportional to the number of 1-bits.

Repeatedly clears the lowest set bit with x &= x-1, so it runs in time proportional to the number of 1-bits.

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW0 stub
  • the section The problem
  • pseudocode in The algorithm
  • complexity claims in the front matter
  • one source with a locator