File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ g(15) = g(1111_2) = 0000_2 &= 0 \\\\
8989
9090There exists a simple implementation using bitwise operations for the non- trivial operation described above:
9191$$ g(i) = i ~ \&~ (i+1),$$
92- where $ \&$ is the logical AND operator. It is not hard to convince yourself that this solution does the same thing as the operation described above.
92+ where $ \&$ is the bitwise AND operator. It is not hard to convince yourself that this solution does the same thing as the operation described above.
9393
9494Now, we just need to find a way to iterate over all $ j$ ' s, such that $g(j) \le i \le j$.
9595
@@ -108,7 +108,7 @@ h(31) = 63 &= 0111111_2 \\\\
108108
109109Unsurprisingly, there also exists a simple way to perform $ h$ using bitwise operations:
110110$$ h(j) = j ~ \|~ (j+1),$$
111- where $ \|$ is the logical OR operator.
111+ where $ \|$ is the bitwise OR operator.
112112
113113The following image shows a possible interpretation of the Fenwick tree as tree.
114114The nodes of the tree show the ranges they cover.
You can’t perform that action at this time.
0 commit comments