Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ba5584 commit fb6dce2Copy full SHA for fb6dce2
src/data_structures/fenwick.md
@@ -398,9 +398,9 @@ And we also update $B_2$. The details will be explained later.
398
```python
399
def range_add(l, r, x):
400
add(B1, l, x)
401
- add(B1, r+1, -x)
402
- add(B2, l, x*(l-1))
403
- add(B2, r+1, -x*r))
+ add(B1, r + 1, -x)
+ add(B2, l, x * (l - 1))
+ add(B2, r + 1, -x * r))
404
```
405
After the range update $(l, r, x)$ the range sum query should return the following values:
406
0 commit comments