From a5b986831bb672e6815e1151620dbfd4e224fb0a Mon Sep 17 00:00:00 2001 From: furthermares Date: Mon, 24 Jul 2023 17:54:13 +0900 Subject: [PATCH] Add a doctest for previous fix --- data_structures/trie/radix_tree.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/data_structures/trie/radix_tree.py b/data_structures/trie/radix_tree.py index fbf04f6e3..016e75328 100644 --- a/data_structures/trie/radix_tree.py +++ b/data_structures/trie/radix_tree.py @@ -54,6 +54,11 @@ class RadixNode: word (str): word to insert >>> 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 # Solution: We set the current node as leaf