1

I search over the internet: I found many solutions of k-repeated substrings usinf Suffix tree but not using Suffix array.

Given string: abaababb

Maximum number of repeated sub-strings ,k = length of string = 6

initially a[0..k]={0}

Frequency of sub-string: "a"= 4 therefore a[4]=1;

Frequency of sub-string: "ab"= 3 therefore a[3]=1;

Frequency of sub-string: "b"= 4 therefore a[4]= a[4]+1 = 2; and so on..

Complexity: < O(nlogn) for array generation.

Using Suffix array:

Suffixes of "abaababb":

LCP  INDEX

0     2    aababb

1     0    abaababb

3     3    ababb

2     5    abb

0     7    b

1     1    baababb

2     4    babb

1     6    bb
Nakshatra
  • 663
  • 1
  • 6
  • 14

1 Answers1

0

Codechef may15 long problem.

This editorial helps me:

http://discuss.codechef.com/questions/69958/cbal-editorial

Nakshatra
  • 663
  • 1
  • 6
  • 14