On Combinatorial Generation of Prefix Normal Words

  • Péter Burcsi
  • Gabriele Fici
  • Zsuzsanna Lipták
  • Frank Ruskey
  • Joe Sawada
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8486)


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.

Unable to display preview. Download preview PDF.


  1. 1.
    Badkobeh, G., Fici, G., Kroon, S., Lipták, Z.: Binary jumbled string matching for highly run-length compressible texts. Inf. Process. Lett. 113(17), 604–608 (2013)CrossRefMATHGoogle Scholar
  2. 2.
    Burcsi, P., Cicalese, F., Fici, G., Lipták, Z.: On Table Arrangements, Scrabble Freaks, and Jumbled Pattern Matching. In: Boldi, P. (ed.) FUN 2010. LNCS, vol. 6099, pp. 89–101. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  3. 3.
    Burcsi, P., Cicalese, F., Fici, G., Lipták, Z.: On approximate jumbled pattern matching in strings. Theory Comput. Syst. 50(1), 35–51 (2012)CrossRefMATHMathSciNetGoogle Scholar
  4. 4.
    Butman, A., Eres, R., Landau, G.M.: Scaled and permuted string matching. Inf. Process. Lett. 92(6), 293–297 (2004)CrossRefMATHMathSciNetGoogle Scholar
  5. 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
  6. 6.
    Cicalese, F., Gagie, T., Giaquinta, E., Laber, E.S., Lipták, Z., Rizzi, R., Tomescu, A.I.: Indexes for jumbled pattern matching in strings, trees and graphs. In: Kurland, O., Lewenstein, M., Porat, E. (eds.) SPIRE 2013. LNCS, vol. 8214, pp. 56–63. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  7. 7.
    Cicalese, F., Laber, E.S., Weimann, O., Yuster, R.: Near linear time construction of an approximate index for all maximum consecutive sub-sums of a sequence. In: Kärkkäinen, J., Stoye, J. (eds.) CPM 2012. LNCS, vol. 7354, pp. 149–158. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  8. 8.
    Fici, G., Lipták, Z.: On prefix normal words. In: Mauri, G., Leporati, A. (eds.) DLT 2011. LNCS, vol. 6795, pp. 228–238. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  9. 9.
    Gagie, T., Hermelin, D., Landau, G.M., Weimann, O.: Binary jumbled pattern matching on trees and tree-like structures. In: Bodlaender, H.L., Italiano, G.F. (eds.) ESA 2013. LNCS, vol. 8125, pp. 517–528. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  10. 10.
    Giaquinta, E., Grabowski, S.: New algorithms for binary jumbled pattern matching. Inf. Process. Lett. 113(14-16), 538–542 (2013)CrossRefMATHMathSciNetGoogle Scholar
  11. 11.
    Kociumaka, T., Radoszewski, J., Rytter, W.: Efficient indexes for jumbled pattern matching with constant-sized alphabet. In: Bodlaender, H.L., Italiano, G.F. (eds.) ESA 2013. LNCS, vol. 8125, pp. 625–636. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  12. 12.
    Lee, L.-K., Lewenstein, M., Zhang, Q.: Parikh matching in the streaming model. In: Calderón-Benavides, L., González-Caro, C., Chávez, E., Ziviani, N. (eds.) SPIRE 2012. LNCS, vol. 7608, pp. 336–341. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  13. 13.
    Moosa, T.M., Rahman, M.S.: Indexing permutations for binary strings. Inf. Process. Lett. 110, 795–798 (2010)CrossRefMATHMathSciNetGoogle Scholar
  14. 14.
    Moosa, T.M., Rahman, M.S.: Sub-quadratic time and linear space data structures for permutation matching in binary strings. J. Discrete Alg. 10, 5–9 (2012)CrossRefMATHMathSciNetGoogle Scholar
  15. 15.
    Ruskey, F., Sawada, J., Williams, A.: Binary bubble languages and cool-lex order. J. Comb. Theory, Ser. A 119(1), 155–169 (2012)CrossRefMATHMathSciNetGoogle Scholar
  16. 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. 17.
    Sawada, J., Williams, A.: Efficient oracles for generating binary bubble languages. Electr. J. Comb. 19(1), P42 (2012)Google Scholar
  18. 18.
    Sloane, N.J.A.: The On-Line Encyclopedia of Integer Sequences. Sequence A194850, Available electronically at
  19. 19.
    Williams, A.M.: Shift Gray Codes. PhD thesis, Univ. of Victoria, Canada (2009)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2014

Authors and Affiliations

  • Péter Burcsi
    • 1
  • Gabriele Fici
    • 2
  • Zsuzsanna Lipták
    • 3
  • Frank Ruskey
    • 4
  • Joe Sawada
    • 5
  1. 1.Department of Computer AlgebraEötvös Loránd UniversityBudapestHungary
  2. 2.Dipartimento di Matematica e InformaticaUniversity of PalermoItaly
  3. 3.Dipartimento di InformaticaUniversity of VeronaItaly
  4. 4.Department of Computer ScienceUniversity of VictoriaCanada
  5. 5.School of Computer ScienceUniversity of GuelphCanada

Personalised recommendations