Update bit_manipulation/count_of_set_bits.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
Swastika Gupta
2021-07-09 07:14:44 +05:30
committed by GitHub
parent c4a6c46b85
commit bf3b032bd4

View File

@@ -5,6 +5,11 @@
* integer.
*
* @details
* We are given an integer number. Lets 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 0s and 1s. 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)