What is a Suffix Tree?

What is a Suffix Tree?

Approach: Describe a compressed trie containing all suffixes of a string.

A compressed trie containing all the suffixes of a given text as their keys and indices in the text as their values. It allows for fast substring queries and pattern matching.

Follow-up: What is a Suffix Array?

Key concepts: pattern matching, substring search, O(n) construction.