MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __init__

Method __init__

data_structures/suffix_tree/suffix_tree.py:13–22  ·  view source on GitHub ↗

Initializes the suffix tree with the given text. Args: text (str): The text for which the suffix tree is to be built.

(self, text: str)

Source from the content-addressed store, hash-verified

11
12class SuffixTree:
13 def __init__(self, text: str) -> None:
14 """
15 Initializes the suffix tree with the given text.
16
17 Args:
18 text (str): The text for which the suffix tree is to be built.
19 """
20 self.text: str = text
21 self.root: SuffixTreeNode = SuffixTreeNode()
22 self.build_suffix_tree()
23
24 def build_suffix_tree(self) -> None:
25 """

Callers

nothing calls this directly

Calls 2

build_suffix_treeMethod · 0.95
SuffixTreeNodeClass · 0.90

Tested by

no test coverage detected