mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 02:18:39 +00:00
Add a doctest for previous fix
This commit is contained in:
parent
4f29d209c8
commit
a5b986831b
@ -54,6 +54,11 @@ class RadixNode:
|
|||||||
word (str): word to insert
|
word (str): word to insert
|
||||||
|
|
||||||
>>> RadixNode("myprefix").insert("mystring")
|
>>> RadixNode("myprefix").insert("mystring")
|
||||||
|
|
||||||
|
>>> root = RadixNode()
|
||||||
|
>>> root.insert_many(['A', 'AA'])
|
||||||
|
>>> root.nodes['A'].nodes['A'].prefix
|
||||||
|
'A'
|
||||||
"""
|
"""
|
||||||
# Case 1: If the word is the prefix of the node
|
# Case 1: If the word is the prefix of the node
|
||||||
# Solution: We set the current node as leaf
|
# Solution: We set the current node as leaf
|
||||||
|
Loading…
x
Reference in New Issue
Block a user