File tree Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ We can see that the all the columns except the leftmost have $4$ (i.e. $2^2$) se
207
207
With the new knowledge in hand we can come up with the following algorithm:
208
208
209
209
- 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*( 2^{x-1}) $.
<
4B16
td data-grid-cell-id="diff-f55b18e9c988850e9ce428a14de86077cadbd65c6bf600edefd94932b4e1cae8-210-210-1" data-selected="false" role="gridcell" style="background-color:var(--diffBlob-additionNum-bgColor, var(--diffBlob-addition-bgColor-num));text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative left-side">210
+ - Calculate the number of set bits from $1$ to $2^x - 1$ by using the formua $x \cdot 2^{x-1}$.
211
211
212
212
The next steps needs more explanation.
213
213
- Count the no. of set bits in the most significant bit from $2^x$ to $n$ and add it.
You can’t perform that action at this time.
0 commit comments