Back to Search
Start Over
Computing the Cover Array in Linear Time
- Source :
- Algorithmica. 32:95-106
- Publication Year :
- 2002
- Publisher :
- Springer Science and Business Media LLC, 2002.
-
Abstract
- Let x denote a given nonempty string of length n = |x| . A proper substring u of x is a proper cover of x if and only if every position of x lies within an occurrence of u within x . This paper introduces an array γ = γ[1..n] called the cover array in which each element γ[i] , 1 ≤ i ≤ n , is the length of the longest proper cover of x[1..i] or zero if no such cover exists. In fact it turns out that γ describes all the covers of every prefix of x . Several interesting properties of γ are established, and a simple algorithm is presented that computes γ on-line in Θ(n) time using Θ(n) additional space. Thus the new algorithm computes for all prefixes of x information that previous cover algorithms could compute only for x itself, and does so with no increase in space or time complexity.
Details
- ISSN :
- 14320541 and 01784617
- Volume :
- 32
- Database :
- OpenAIRE
- Journal :
- Algorithmica
- Accession number :
- edsair.doi...........e5605f2f5fd7c752e759987f9ce7de53
- Full Text :
- https://doi.org/10.1007/s00453-001-0062-2