
In this article, we will learn what are set bits and how to count them. And we will also learn about Brian Kernighan's algorithm a famous algorithm to find the number of set bits in a number.
Table of content:
IntroductionBrute force methodBrian Kernighan's AlgorithmComplexity of Brian Kernighan's AlgorithmConclusionIntroduction
Brian Kernighan's algorithm is used to calculate the number of set bits in a given number. But what is a set bit?
In computers, we know that data is represented a...
Published on August 18, 2021 09:26