/
ssmih
/
Python
Обзор
Документация
Войти
/
ssmih
/
Python
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
data_structures/suffix_tree/suffix_tree_node.py
36 строк
1 KB
Ramy
Implemented Suffix Tree Data Structure (#11554)
28 сен 2024, 16:37
Не верифицирован
28 сен 2024, 16:37
976e385
Код
Авторство
О чём код?
# Created by: Ramy-Badr-Ahmed (https://github.com/Ramy-Badr-Ahmed) # in Pull Request: #11554 # https://github.com/TheAlgorithms/Python/pull/11554 # # Please mention me (@Ramy-Badr-Ahmed) in any issue or pull request # addressing bugs/corrections to this file. # Thank you! from __future__ import annotations class SuffixTreeNode: def __init__( self, children: dict[str, SuffixTreeNode] | None = None, is_end_of_string: bool = False, start: int | None = None, end: int | None = None, suffix_link: SuffixTreeNode | None = None, ) -> None: """ Initializes a suffix tree node. Parameters: children (dict[str, SuffixTreeNode] | None): The children of this node. is_end_of_string (bool): Indicates if this node represents the end of a string. start (int | None): The start index of the suffix in the text. end (int | None): The end index of the suffix in the text. suffix_link (SuffixTreeNode | None): Link to another suffix tree node. """ self.children = children or {} self.is_end_of_string = is_end_of_string self.start = start self.end = end self.suffix_link = suffix_link