Skip to content

Commit f7f4980

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 6f62279 commit f7f4980

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

data_structures/binary_tree/segment_tree_node.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from typing import Optional
22

3+
34
class Node:
45
def __init__(self, start: int, end: int) -> None:
56
# Initializes a segment tree node with start and end indices
@@ -9,6 +10,7 @@ def __init__(self, start: int, end: int) -> None:
910
self.left: Optional["Node"] = None
1011
self.right: Optional["Node"] = None
1112

13+
1214
class SegmentTree:
1315
def __init__(self, nums: list[int], mode: str = "max") -> None:
1416
"""
@@ -110,7 +112,9 @@ def query(
110112
self.query(node.right, start_index, end_index, mid + 1, end),
111113
)
112114
else:
113-
return self.query(node.left, start_index, end_index, start, mid) + self.query(node.right, start_index, end_index, mid + 1, end)
115+
return self.query(
116+
node.left, start_index, end_index, start, mid
117+
) + self.query(node.right, start_index, end_index, mid + 1, end)
114118

115119
def update(self, index: int, new_value: int) -> int:
116120
"""

0 commit comments

Comments
 (0)