From 0f3ce1398c9350ecdf4834d2f6c2a3452dfa20ee Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 24 Jul 2023 11:04:50 +0200 Subject: [PATCH] Test the doctest --- data_structures/trie/radix_tree.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/data_structures/trie/radix_tree.py b/data_structures/trie/radix_tree.py index cf2f25c29f13..5f69b58947c5 100644 --- a/data_structures/trie/radix_tree.py +++ b/data_structures/trie/radix_tree.py @@ -53,7 +53,12 @@ def insert(self, word: str) -> None: Args: word (str): word to insert - >>> RadixNode("myprefix").insert("mystring") + >>> RadixNode("myprefix").insert("mystring") is None + True + >>> 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