Maximal pair

Uses your system voice; voice and rate in settings.

Snapshot

≈ 1 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

In computer science, a maximal pair within a string is a pair of matching substrings that are maximal, where "maximal" means that it is not possible to make a longer matching pair by extending the range of both substrings to the left or right.

In computer science, a maximal pair within a string is a pair of matching substrings that are maximal, where "maximal" means that it is not possible to make a longer matching pair by extending the range of both substrings to the left or right. Formally, a maximal pair of substrings with starting positions p_1 and p_2 respectively, and both of length l , is specified by a triple (p_1, p_2, l) , such that, given a string S of length n , S[p_1..p_1+l-1]=S[p_2..p_2+l-1] (meaning that the substrings have identical contents), but S[p_1-1] \neq S[p_2-1] (they have different characters to their left) and S[p_1+l] \neq S[p_2+l] (they also have different characters to their right; together, these two inequalities are the condition for being maximal). Thus, in the example above, the maximal pairs are (2,6,3) (the red and blue substrings) and (6,10,3) (the green and blue substrings), and (2,10,3) is not a maximal pair.

Text derived from https://en.wikipedia.org/w/index.php?oldid=1373395723 under CC BY-SA 4.0; modifications have been made.

Sources cited in this revision

Extracted from the cited revision's reference blocks; absent citations are not invented.