Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0ea5316

Browse files
authored
Reword logical operator to bitwise operator
Fixes #434
1 parent 239284e commit 0ea5316

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/data_structures/fenwick.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ g(15) = g(1111_2) = 0000_2 &= 0 \\\\
8989

9090
There 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

9494
Now, 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

109109
Unsurprisingly, 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

113113
The following image shows a possible interpretation of the Fenwick tree as tree.
114114
The nodes of the tree show the ranges they cover.

0 commit comments

Comments
 (0)