On Combinatorial Generation of Prefix Normal Words
A prefix normal word is a binary word with the property that no substring has more 1s than the prefix of the same length. This class of words is important in the context of binary jumbled pattern matching. In this paper we present an efficient algorithm for exhaustively listing the prefix normal words with a fixed length. The algorithm is based on the fact that the language of prefix normal words is a bubble language, a class of binary languages with the property that, for any word w in the language, exchanging the first occurrence of 01 by 10 in w results in another word in the language. We prove that each prefix normal word is produced in O(n) amortized time, and conjecture, based on experimental evidence, that the true amortized running time is O(log(n)).
Unable to display preview. Download preview PDF.
- 5.Cicalese, F., Fici, G., Lipták, Z.: Searching for jumbled patterns in strings. In: Proc. of the Prague Stringology Conference 2009 (PSC 2009), pp. 105–117. Czech Technical University in Prague (2009)Google Scholar
- 16.Ruskey, F., Sawada, J., Williams, A.: De Bruijn sequences for fixed-weight binary strings. SIAM Journal of Discrete Mathematics 26(2), 605–517 (2012)Google Scholar
- 17.Sawada, J., Williams, A.: Efficient oracles for generating binary bubble languages. Electr. J. Comb. 19(1), P42 (2012)Google Scholar
- 18.Sloane, N.J.A.: The On-Line Encyclopedia of Integer Sequences. Sequence A194850, Available electronically at http://oeis.org
- 19.Williams, A.M.: Shift Gray Codes. PhD thesis, Univ. of Victoria, Canada (2009)Google Scholar