We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c1b3ea5 commit 438c795Copy full SHA for 438c795
data_structures/binary_tree/segment_tree.py
@@ -7,7 +7,8 @@ def __init__(self, a):
7
self.st = [0] * (
8
4 * self.N
9
) # approximate the overall size of segment tree with array N
10
- self.build(1, 0, self.N - 1)
+ if self.N:
11
+ self.build(1, 0, self.N - 1)
12
13
def left(self, idx):
14
return idx * 2
0 commit comments