155 questions
0 votes
1 answer
88 views
How to find different k-grams of a string using a suffix array?
I'm trying to write a function (in Python) how many different K-grams a string has. How can I compute it using a suffix array and a LCP array (I already have them computed)?
0 votes
1 answer
180 views
Trouble understanding DC3 algorithm
The paper i am going through: https://www.cs.helsinki.fi/u/tpkarkka/publications/jacm05-revised.pdf I think its the same question as Suffix array DC3 algorithm, but since I am unable to access the ...
0 votes
0 answers
96 views
Trying to quick sort a suffix array
I am trying to apply quick sort to suffix array. The suffix array contains all the starting indexes of the string. The first partition works but not the others. I have reviewed many quick sort code ...
-1 votes
6 answers
4k views
Optimization: Count the number of suffix pairs
Question: Count the total number of pairs in a list of strings, so that for each pair, one string is the suffix of the other. For example, "door" is the suffix of "backdoor", "...
0 votes
1 answer
690 views
Practical implementation of suffix array
Looking for a practical implementation of suffix arrays, I came across this paper. It outlines a O(n (log n * log n)) approach, where n is the length of the string. While there are faster algorithms ...
1 vote
1 answer
261 views
Efficient way to collect all unique substrings of a string
I need to identify all substrings in a string with a minimum size and repeats. The caveat is that I don't want substrings returned that are themselves substrings of other returned substrings. In other ...
1 vote
1 answer
405 views
Suffix Array, n^2*log(n) faster than n*log^2(n) even for large inputs?
I learned this theory in class and decided to implement everything to make sure I understood it all; but the theoretical results don't align with the memory and time usages I obtain. I'm pretty sure ...
0 votes
2 answers
254 views
Implementations for Pattern/String mining using Suffix Arrays/Trees
I am trying to solve a pattern mining problem for strings and I think that suffix trees or arrays might be a good option to solve this problem. I will quickly outline the problem: I have a set strings ...
0 votes
0 answers
50 views
Segmentation Fault in Suffix Array Implementation
when I run the following code written to implement the suffix array algorithm, I get a segmentation fault. Can anyone please help me in solving it? I think the issue is with the while since cout in ...
0 votes
1 answer
112 views
What is the Big O notation of a program?
I am trying to determine the algorithmic complexity of this program: import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class SuffixArray { ...
-1 votes
3 answers
692 views
I want to define (create) and use different variable (using suffix) through loop (specially for loop)
I want to create multiple variable through for loop to further use and compare in the program. Here is the code - for i in range(0,len(Header_list)): (f'len_{i} = {len(Header_list[i]) + 2 }') ...
0 votes
1 answer
110 views
linear time algorithm for finding most frequent m-letter substring in a string
Suppose we have a n letter string and we are searching for most repeated m letter substring (1=<m =< n). I am just searching for an algorithm which solves this problem in linear time. And I have ...
0 votes
0 answers
153 views
Most repeated substring in a string in C
Due to our problem, I need to find the most repeated substring in a string. The way I followed for this was as follows: I found the suffixes of the string, then I found the prefixes of the suffixes ...
1 vote
2 answers
781 views
How to find the longest common substring of n strings using suffix array?
I could do longest common substring using two strings each time. But consider 3 strings below: ABZDCC ABZDEC EFGHIC Here we see that the lcs of the first two strings is ABZD. But when this will be ...
0 votes
1 answer
103 views
Which character to append to string in suffix array?
I was solving https://www.spoj.com/problems/BEADS/ above question at SPOJ. I have stated the relevant information below: Problem Statement: The description of the necklace is a string A = a1a2 ... am ...