Skip to content

Commit 82011c4

Browse files
Fix typo in bit-manipulation.md
1 parent d199d64 commit 82011c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/algebra/bit-manipulation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ We can see that the all the columns except the leftmost have $4$ (i.e. $2^2$) se
207207
With the new knowledge in hand we can come up with the following algorithm:
208208
209209
- Find the highest power of $2$ that is lesser than or equal to the given number. Let this number be $x$.
210-
- Calculate the number of set bits from $1$ to $2^x - 1$ by using the formua $x \cdot 2^{x-1}$.
210+
- Calculate the number of set bits from $1$ to $2^x - 1$ by using the formula $x \cdot 2^{x-1}$.
211211
- Count the no. of set bits in the most significant bit from $2^x$ to $n$ and add it.
212212
- Subtract $2^x$ from $n$ and repeat the above steps using the new $n$.
213213

0 commit comments

Comments
 (0)