(self, prefix: str = "", is_leaf: bool = False)
| 7 | |
| 8 | class RadixNode: |
| 9 | def __init__(self, prefix: str = "", is_leaf: bool = False) -> None: |
| 10 | # Mapping from the first character of the prefix of the node |
| 11 | self.nodes: dict[str, RadixNode] = {} |
| 12 | |
| 13 | # A node will be a leaf if the tree contains its word |
| 14 | self.is_leaf = is_leaf |
| 15 | |
| 16 | self.prefix = prefix |
| 17 | |
| 18 | def match(self, word: str) -> tuple[str, str, str]: |
| 19 | """Compute the common substring of the prefix of the node and a word |
nothing calls this directly
no outgoing calls
no test coverage detected