Skip to content

Commit

Permalink
MannCode:TheAlgorithms#11232. Refactor show_data method to use instan…
Browse files Browse the repository at this point in the history
…ce attribute self.N instead of global variable N for better encapsulation and readability.
  • Loading branch information
MannCode committed Feb 25, 2024
1 parent c6ca194 commit 55c1faa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion data_structures/binary_tree/segment_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def query_recursive(self, idx, l, r, a, b): # noqa: E741

def show_data(self):
show_list = []
for i in range(1, N + 1):
for i in range(1, self.N + 1):
show_list += [self.query(i, i)]
print(show_list)

Expand Down

0 comments on commit 55c1faa

Please sign in to comment.