mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-05-05 20:48:22 +08:00
Update bit_manipulation/count_of_set_bits.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
@@ -5,6 +5,11 @@
|
||||
* integer.
|
||||
*
|
||||
* @details
|
||||
* We are given an integer number. Let’s say, number. The task is to first calculate the
|
||||
* binary digit of a number and then calculate the total set bits of a number.
|
||||
*
|
||||
* Set bits in a binary number is represented by 1. Whenever we calculate the binary number of an integer value
|
||||
* it is formed as the combination of 0’s and 1’s. So digit 1 is known as a set bit in computer terms.
|
||||
* Time Complexity :- O(log n)
|
||||
* Space complexity :- O(1)
|
||||
* @author [Swastika Gupta](https://github.com/swastyy)
|
||||
|
||||
Reference in New Issue
Block a user