Kumar-laxmi / Algorithms

A Repository for algorithms in C, C++, Python and Java
Apache License 2.0
315 stars 365 forks source link

Brian kernighan algorithm #1433

Closed Jyoti040 closed 5 months ago

Jyoti040 commented 1 year ago

Is your feature request related to a problem? Please describe.

The problem is to find the number of set bits in binary representation of a number.

Describe the solution you'd like

Brian kernighan algorithm is an efficient algorithm which uses bitwise and operation and helps to find number of set bits . Set bits refer to number of 1s in binary representation of a number. Time complexity - O(log N) Auxiliary space - O(1)

[Describe alternatives you've considered]()

Lookup table method can also be used to solve this problem

Additional context

I want to work under SSOC'23. I want to add this algorithm in maths section, please assign this to me.

anasadh commented 1 year ago

@Kumar-laxmi please assign me this

github-actions[bot] commented 5 months ago

Stale issue message