MCP
arXivarXiv
Preprint
Published: April 24, 2022
cs.DS

String Rearrangement Inequalities and a Total Order Between Primitive Words

Abstract
We study the following rearrangement problem: Given nn words, rearrange and concatenate them so that the obtained string is lexicographically smallest (or largest, respectively). We show that this problem reduces to sorting the given words so that their repeating strings are non-decreasing (or non-increasing, respectively), where the repeating string of a word AA refers to the infinite string AAA…AAA\ldots. Moreover, for fixed size alphabet Σ\Sigma, we design an O(L)O(L) time sorting algorithm of the words (in the mentioned orders), where LL denotes the total length of the input words. Hence we obtain an O(L)O(L) time algorithm for the rearrangement problem. Finally, we point out that comparing primitive words via comparing their repeating strings leads to a total order, which can further be extended to a total order on the finite words (or all words).
0
AI overview
Reviews
Citation graph
Structured
This paper does not have an AI preview yet
Rating
No ratings yet
Rate
Community rating
—
/ 5
No ratings yet
Rating
—
Soundness
—
Presentation
—
Contribution
—
Confidence
—
Discussion
Top
Newest
Questions
Replication
Author
No comments yet — be the first