English

Ranking and unranking bordered and unbordered words

Data Structures and Algorithms 2023-08-30 v2 Discrete Mathematics

Abstract

A \emph{border} of a word ww is a word that is both a non-empty proper prefix and suffix of ww. If ww has a border, then it is said to be \emph{bordered}; otherwise, it is said to be \emph{unbordered}. The main results of this paper are the first algorithms to rank and unrank length-nn bordered and unbordered words over a kk-letter alphabet. We show that, under the unit-cost RAM model, ranking bordered and unbordered words can be done in O(kn3)O(kn^3) time using O(n)O(n) space, and unranking them can be done in O(n4klogk)O(n^4k\log k) time using O(n)O(n) space.

Keywords

Cite

@article{arxiv.2305.03000,
  title  = {Ranking and unranking bordered and unbordered words},
  author = {Daniel Gabric},
  journal= {arXiv preprint arXiv:2305.03000},
  year   = {2023}
}
R2 v1 2026-06-28T10:25:55.100Z