Maximal pair
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.[src]
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.[src] 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).[src] 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.[src]
4 sentences · 4 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Maximal pair." encyclopegia.org, 2026, https://encyclopegia.org/wiki/maximal-pair. Accessed 27 November 2026.
Chicago
"Maximal pair." encyclopegia.org. Accessed November 27, 2026. https://encyclopegia.org/wiki/maximal-pair.
APA
encyclopegia.org. (2026). Maximal pair. Retrieved November 27, 2026, from https://encyclopegia.org/wiki/maximal-pair
Accessed November 27, 2026 · CC BY-SA 4.0 · citation page · JSON