suffixtrees
A suffix tree is a data structure that represents all suffixes of a given string as paths from a common root in a compressed trie. Edges are labeled with substrings of the string, and each suffix S[i..n] corresponds to a leaf. Internal nodes correspond to substrings that occur as prefixes of several suffixes. The tree enables efficient substring queries and pattern matching.
In a suffix tree, every internal node has at least two children, and edges are labeled with
Construction and complexity: The classic online construction uses Ukkonen’s algorithm, which builds a suffix tree in
Applications: Suffix trees enable fast substring search in O(m) time for a pattern of length m, by