Skip to content

Commit

Permalink
nitpick on comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyod committed Oct 1, 2024
1 parent 7b88af1 commit 27d2b4b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/test_fenwick.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,15 @@ def test_bisect_left(self):

# Create a cumulative sum
cumsum = list(itertools.accumulate(frequencies))
test_values = [-5, 0.5, 1, 2, 3, 7]

# Test at some random values, including edge cases
test_values = [-5, 0.5, 1, 2, 3, 7]
for test_value in test_values:
# Indexing the FenwickTree
index_fenwick = tree.bisect_right(test_value)
index_bisect = bisect.bisect_right(cumsum, test_value)
self.assertEqual(index_fenwick, index_bisect)


# Test a specific edge case. The cumsums are [1, 3, 6], and the

# Test a specific case. The cumsums are [1, 3, 6], and the
# smallest index i such that cumsum[i] > 3 is 2.
self.assertEqual(tree.bisect_right(3), 2)

Expand Down

0 comments on commit 27d2b4b

Please sign in to comment.