Skip to content

Commit 1f00e30

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

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

data_structures/advanced_trie.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,13 +368,13 @@ def _pattern_search_helper(
368368
) -> None:
369369
"""
370370
Helper method for pattern search.
371-
371+
372372
Args:
373373
node: Current trie node
374374
current_word: Current word being built
375375
pattern: Pattern to match
376376
words: List to collect matching words
377-
377+
378378
Examples:
379379
>>> trie = Trie()
380380
>>> trie.insert("hello")
@@ -430,7 +430,7 @@ def get_all_words(self) -> list[str]:
430430
def clear(self) -> None:
431431
"""
432432
Clear all words from the trie.
433-
433+
434434
Examples:
435435
>>> trie = Trie()
436436
>>> trie.insert("hello")

data_structures/segment_tree.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ def __init__(
6666
def _build(self, node: int, start: int, end: int) -> None:
6767
"""
6868
Build the segment tree recursively.
69-
69+
7070
Args:
7171
node: Current node index
7272
start: Start of current segment
7373
end: End of current segment
74-
74+
7575
Examples:
7676
>>> st = SegmentTree([1, 2, 3, 4, 5])
7777
>>> st._build(0, 0, 4) # Builds the entire tree
@@ -247,12 +247,12 @@ def _build(self, node: int, start: int, end: int) -> None:
247247
def _push_lazy(self, node: int, start: int, end: int) -> None:
248248
"""
249249
Push lazy updates to children.
250-
250+
251251
Args:
252252
node: Current node index
253253
start: Start of current segment
254254
end: End of current segment
255-
255+
256256
Examples:
257257
>>> lst = LazySegmentTree([1, 2, 3, 4, 5])
258258
>>> lst.lazy[0] = 2
@@ -279,7 +279,7 @@ def range_update(self, left: int, right: int, delta: int) -> None:
279279
left: Left boundary (0-indexed)
280280
right: Right boundary (0-indexed)
281281
delta: Value to add to the range
282-
282+
283283
Examples:
284284
>>> lst = LazySegmentTree([1, 2, 3, 4, 5])
285285
>>> lst.range_update(1, 3, 2)
@@ -344,7 +344,7 @@ def query(self, left: int, right: int) -> int:
344344
345345
Returns:
346346
Result of the operation over the range
347-
347+
348348
Examples:
349349
>>> lst = LazySegmentTree([1, 2, 3, 4, 5])
350350
>>> lst.query(1, 3)
@@ -361,17 +361,17 @@ def query(self, left: int, right: int) -> int:
361361
def _query(self, node: int, start: int, end: int, left: int, right: int) -> int:
362362
"""
363363
Internal query method.
364-
364+
365365
Args:
366366
node: Current node index
367367
start: Start of current segment
368368
end: End of current segment
369369
left: Left boundary of query
370370
right: Right boundary of query
371-
371+
372372
Returns:
373373
Result of the operation over the range
374-
374+
375375
Examples:
376376
>>> lst = LazySegmentTree([1, 2, 3, 4, 5])
377377
>>> lst._query(0, 0, 4, 1, 3)

0 commit comments

Comments
 (0)