improve doctest readability

This commit is contained in:
furthermares 2023-07-24 18:23:36 +09:00
parent a5b986831b
commit d918fcbf65

View File

@ -56,9 +56,11 @@ class RadixNode:
>>> RadixNode("myprefix").insert("mystring") >>> RadixNode("myprefix").insert("mystring")
>>> root = RadixNode() >>> root = RadixNode()
>>> root.insert_many(['A', 'AA']) >>> root.insert_many(['myprefix', 'myprefixA', 'myprefixAA'])
>>> root.nodes['A'].nodes['A'].prefix >>> root.print_tree()
'A' - myprefix (leaf)
-- A (leaf)
--- A (leaf)
""" """
# 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