In computer science, the longest repeated substring problem is the problem of finding the longest substring of a string that occurs at least twice.
This problem can be solved in linear time and space by building a suffix tree for the string (with a special end-of-string symbol like '$' appended), and finding the deepest internal node in the tree with more than one child. Depth is measured by the number of characters traversed from the root. The string spelled by the edges from the root to such a node is a longest repeated substring. The problem of finding the longest substring with at least occurrences can be solved by first preprocessing the tree to count the number of leaf descendants for each internal node, and then finding the deepest node with at least leaf descendants. To avoid overlapping repeats, you can check that the list of suffix lengths has no consecutive elements with less than prefix-length difference.
In the figure with the string "ATCGATCGA$", the longest substring that repeats at least twice is "ATCGA".
and 11 Related for: Longest repeated substring problem information
science, the longestrepeatedsubstringproblem is the problem of finding the longestsubstring of a string that occurs at least twice. This problem can be...
LZ77 factorization in O ( n ) {\displaystyle O(n)} time. The longestrepeatedsubstringproblem for a string S {\displaystyle S} of length n {\displaystyle...
operations can be performed quickly, such as locating a substring in S {\displaystyle S} , locating a substring if a certain number of mistakes are allowed, and...
entire word has been read completely. It is possible to find the longest palindromic substring of a given input string in linear time. The palindromic density...
numbers Longest common substringproblem: find the longest string (or strings) that is a substring (or are substrings) of two or more strings Substring search...
{\textstyle n} -string and let S [ i , j ] {\displaystyle S[i,j]} denote the substring of S {\displaystyle S} ranging from i {\displaystyle i} to j {\displaystyle...
case here is gravely pathological: both the text string and substring are composed of a repeated single character, such as t="AAAAAAAAAAA", and s="AAA")....
a repeated syllable (i.e. ba, ba, ba) the span is reduced (articulatory suppression effect) Rhythm of presentation: Closely related to the problem of...
looping with PERFORM UNTIL EXIT SUBSTITUTE intrinsic function allowing for substring substitution of different length CONVERT function for base-conversion...
covered in several variations including edit distance and the longest common subsequence problem. The book concludes with advanced topics including two-dimensional...
the riddle of Chinese characters, where partial characters instead of substrings are clued and combined. Clues given to the solver are based on various...