File: suffix_array.rb [algorithms-0.6.1 Documentation]

Last Modified
  2015-08-04 14:39:22 +0000
Requires

## Description

A suffix array enables fast substring search of a given string. An array of all possible substrings is constructed and stored, and a binary search is then done to find a desired substring among those stored. While more storage (and thus memory) is needed to create the SuffixArray, the advantage is that substrings can be found in O(m log n) time, where m is the length of the substring to search for and n is the total number of substrings.