Computing Atlas

How Computing Was Built
Sign In
Text size
100%
Theme
Algorithm

Suffix Array Construction Algorithm

String Algorithm

A suffix array is a sorted array of all the starting positions of every suffix of a string, and a suffix array construction algorithm builds this array efficiently rather than by the naive approach of generating and sorting every suffix directly, which is slow for long strings. Efficient construction methods use techniques such as prefix doubling, sorting suffixes by successively longer prefixes whose lengths double at each round, achieving O(n log n) time, while later linear-time methods such as the DC3 or skew algorithm achieve O(n) construction. Once built, a suffix array supports fast substring search and underlies many string processing structures, including full-text indexes and the Burrows-Wheeler transform.

Facts
Time Complexity
O(n), linear time, by building a suffix tree in O(n) and converting it to a suffix array by depth-first traversal in O(n) 1
Credited To
Manber and Myers, 1990 (introduction of suffix arrays) 1
Sources
1. Wikipedia: Suffix Array
Wikimedia Foundation
  • Construction algorithms section
    so there exist algorithms that can build a suffix array in O ( n )
  • Introduction
    Suffix arrays were introduced by Manber & Myers (1990) as a simple, space efficient alternative to suffix trees.
View the Source
Comments (0)
No comments yet. Be the first to share a thought.
Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.