Skip to content
StackDecode
StringsExplained

Suffix Array

The sorted list of all suffixes of a string.

Time

O(n log n) build

Extra space

O(n)

Use it for

Substring search, repeats, compression.

An animated walkthrough for this algorithm isn’t built yet. The summary above explains the idea; see the related animated algorithms below to practise the same technique.