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

Class SuffixTreeNode

data_structures/suffix_tree/suffix_tree_node.py:12–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11
12class SuffixTreeNode:
13 def __init__(
14 self,
15 children: dict[str, SuffixTreeNode] | None = None,
16 is_end_of_string: bool = False,
17 start: int | None = None,
18 end: int | None = None,
19 suffix_link: SuffixTreeNode | None = None,
20 ) -> None:
21 """
22 Initializes a suffix tree node.
23
24 Parameters:
25 children (dict[str, SuffixTreeNode] | None): The children of this node.
26 is_end_of_string (bool): Indicates if this node represents
27 the end of a string.
28 start (int | None): The start index of the suffix in the text.
29 end (int | None): The end index of the suffix in the text.
30 suffix_link (SuffixTreeNode | None): Link to another suffix tree node.
31 """
32 self.children = children or {}
33 self.is_end_of_string = is_end_of_string
34 self.start = start
35 self.end = end
36 self.suffix_link = suffix_link

Callers 2

__init__Method · 0.90
_add_suffixMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected