Skip to content

Commit ed60a0b

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

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

data_structures/binary_tree/b_tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def split(self, parent: BTreeNode, index: int) -> None:
4242
new_node = BTreeNode(is_leaf=self.is_leaf)
4343
mid_index = len(self.keys) // 2
4444
median_key = self.keys[mid_index]
45-
45+
4646
new_node.keys = self.keys[mid_index + 1 :]
4747
self.keys = self.keys[:mid_index]
4848

data_structures/trie/trie_autocomplete.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,7 @@ def _collect_words_with_frequency(
215215
results.append((current_word, node.frequency))
216216

217217
for char, child_node in node.children.items():
218-
self._collect_words_with_frequency(
219-
child_node, current_word + char, results
220-
)
218+
self._collect_words_with_frequency(child_node, current_word + char, results)
221219

222220
def delete(self, word: str) -> bool:
223221
"""
@@ -266,7 +264,7 @@ def _delete_helper(node: TrieNode, word: str, index: int) -> bool:
266264
node = self._find_node(word.lower())
267265
if node is None or not node.is_end_of_word:
268266
return False
269-
267+
270268
_delete_helper(self.root, word.lower(), 0)
271269
return True
272270

0 commit comments

Comments
 (0)