Skip to content

Commit 2903d48

Browse files
committed
Add doctest for previous fix
1 parent 6bc1c1f commit 2903d48

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: data_structures/trie/radix_tree.py

+5
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ def insert(self, word: str) -> None:
5959
word (str): word to insert
6060
6161
>>> RadixNode("myprefix").insert("mystring")
62+
63+
>>> root = RadixNode()
64+
>>> root.insert_many(['A', 'AA'])
65+
>>> root.nodes['A'].nodes['A'].prefix
66+
'A'
6267
"""
6368
# Case 1: If the word is the prefix of the node
6469
# Solution: We set the current node as leaf

0 commit comments

Comments
 (0)