# Suffix Array

SUPER USEFUL Suffix Arrays as a data structure are widely used in areas such as data compression, bioinformatics. They are great for string matching problems.

Let $s$ be a string of length $n$. The $i$-th suffix of $s$ is the substring $s[iā¦nā1]$.

Since it is not efficient to store all the substrings, theĀ **suffix array**Ā will only store the integers that represent theĀ **starting indexes**Ā of the all the suffixes of a given string, after the aforementioned suffixes are sorted.

Resources

### Applications

Finding a substring in a string (ONLINE) ā If you know the string $s$ beforehand, you can just use the Z-Algorithm. However, if you donāt know the string $s$ beforehand.