Skip to content

Commit 55c1faa

Browse files
committed
MannCode:TheAlgorithms#11232. Refactor show_data method to use instance attribute self.N instead of global variable N for better encapsulation and readability.
1 parent c6ca194 commit 55c1faa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: data_structures/binary_tree/segment_tree.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def query_recursive(self, idx, l, r, a, b): # noqa: E741
9898

9999
def show_data(self):
100100
show_list = []
101-
for i in range(1, N + 1):
101+
for i in range(1, self.N + 1):
102102
show_list += [self.query(i, i)]
103103
print(show_list)
104104

0 commit comments

Comments
 (0)