Skip to content

Commit

Permalink
fix flake8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyod committed Sep 5, 2024
1 parent d2b0515 commit acf033d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions fenwick/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
from .fenwick import FenwickTree, __version__

__all__ = ["FenwickTree", "__version__"]
3 changes: 2 additions & 1 deletion fenwick/fenwick.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# * Core
# ************************************************************


class FenwickTree(object):
"""
A data structure for maintaining cumulative (prefix) sums.
Expand Down Expand Up @@ -88,7 +89,7 @@ def init(self, frequencies):
raise ValueError("Length of frequencies must match length of FenwickTree.")
self._v = list(frequencies)
for idx in range(1, self._n + 1):
parent_idx = idx + (idx & -idx) # parent in update tree
parent_idx = idx + (idx & -idx) # parent in update tree
if parent_idx <= self._n:
self._v[parent_idx - 1] += self._v[idx - 1]

Expand Down

0 comments on commit acf033d

Please sign in to comment.