Skip to content

Commit c9207e2

Browse files
pre-commit-ci[bot]rtron-24
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 394802a commit c9207e2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

data_structures/trie/radix_tree.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,11 @@ def print_tree(self, height: int = 0) -> None:
196196
for value in self.nodes.values():
197197
value.print_tree(height + 1)
198198

199+
199200
## write unit test for the code using unittest library with logic similar to test_trie() function
200201
## and call it from main()
201202

203+
202204
class TestRadixNode(unittest.TestCase):
203205
def test_trie(self) -> None:
204206
words = "banana bananas bandana band apple all beast".split()
@@ -215,10 +217,10 @@ def test_trie(self) -> None:
215217
assert root.find("bananas")
216218

217219
def test_trie_2(self) -> None:
218-
'''
219-
now add a new test case which inserts
220+
"""
221+
now add a new test case which inserts
220222
foobbb, fooaaa, foo in the given order and checks for different assertions
221-
'''
223+
"""
222224
words = "foobbb fooaaa foo".split()
223225
root = RadixNode()
224226
root.insert_many(words)
@@ -229,5 +231,6 @@ def test_trie_2(self) -> None:
229231
assert root.find("foobbb")
230232
assert root.find("fooaaa")
231233

234+
232235
if __name__ == "__main__":
233236
unittest.main()

0 commit comments

Comments
 (0)