A word over an alphabet is a finite sequence of symbols from . The empty word has length zero, and denotes the set of all finite words.
A string suffix consists of all characters from some position to the end of a string. For example, TAC has suffixes TAC, AC, C and the empty string. Sorting these in lexicographic order groups all suffixes beginning with a given query into one interval.
A cyclic rotation of a string is the string , where and are consecutive pieces. For example, rotating ABC left once gives BCA. A length- string has rotation positions, though repeated letters can make some resulting strings identical.
A substring is a contiguous segment of a string. It differs from a subsequence, whose selected characters need not be adjacent.
An infinite binary word is Sturmian if it has exactly distinct contiguous subwords of length for every positive integer .
A palindrome is a finite string equal to its reversal. For example, the strings and are palindromes.
Decide whether a finite string is a palindrome by comparing corresponding symbols from opposite ends. The test needs at most half as many symbol comparisons as the string length and can use constant auxiliary space.
Concatenation joins two strings end to end, retaining the order of their symbols. For example, joining and gives . It has the associative property: joining or gives the same word over an alphabet. The empty word is its identity element. All finite words over an alphabet with this binary operation form a free monoid.
The length of a word over an alphabet is the number of symbol positions in that finite string, counting repetitions. Thus and for the empty word. Concatenation satisfies . This differs from the word length of a group element, which minimizes over representing words using a chosen generating set of a group.
A run of a word over an alphabet is a maximal consecutive block of one repeated letter. For a nonempty word of length , its number of runs is
Replacing a consecutive constant block changes this count only through its boundaries with the neighboring letters.
A border of a word is a nonempty prefix that is also a suffix. The full word is counted as a border; a shorter border records a way in which one occurrence can overlap the next.

Articles by others on the same topic (0)

There are currently no matching articles.