IDEAS home Printed from https://ideas.repec.org/a/spr/jcomop/vyid10.1007_s10878-019-00469-z.html
   My bibliography  Save this article

Improved algorithms for ranking and unranking (k, m)-ary trees in B-order

Author

Listed:
  • Yu-Hsuan Chang

    (National Taipei University of Business)

  • Ro-Yu Wu

    (Lunghwa University of Science and Technology)

  • Ruay-Shiung Chang

    (National Taipei University of Business)

  • Jou-Ming Chang

    (National Taipei University of Business)

Abstract

Du and Liu (Eur J Comb 28:1312–1321, 2007) introduced (k, m)-ary trees as a generalization of k-ary trees. In a (k, m)-ary tree, every node on even level has degree k (i.e., has k children), and every node on odd level has degree m (which is called a crucial node) or is a leaf. In particular, a (k, m)-ary tree of order n has exactly n crucial nodes. Recently, Amani and Nowzari-Dalini (Bull Iranian Math Soc 45(4):1145–1158, 2019) presented a generation algorithm to produce all (k, m)-ary trees of order n in B-order using Zaks’ encoding, and showed that the generated ordering of this encoding results in a reverse-lexicographical ordering. They also proposed the corresponding ranking and unranking algorithms for (k, m)-ary trees according to such a generated ordering. These algorithms take $$\mathcal {O}(kmn^2)$$O(kmn2) time and space for building a precomputed table in which (k, m)-Catalan numbers (i.e., a kind of generalized Catalan numbers) are stored in advance. Then, each ranking and unranking algorithm can be performed subsequently in $$\mathcal {O}(n)$$O(n) and $$\mathcal {O}(n\log n)$$O(nlogn) time, respectively. In this paper, we revisit the ranking and unranking problems. With the help of an encoding scheme called “right-distance” introduced by Wu et al. (Math Comput Model 53:1331–1335, 2011a; IEICE Trans Inf Syst E94–D:226–232, 2011b), we propose new ranking and unranking algorithms for (k, m)-ary trees of order n in B-order using Zaks’ encoding. We show that both algorithms can be improved in $$\mathcal {O}(kmn)$$O(kmn) time and $$\mathcal {O}(n)$$O(n) space without building the precomputed table.

Suggested Citation

  • Yu-Hsuan Chang & Ro-Yu Wu & Ruay-Shiung Chang & Jou-Ming Chang, 0. "Improved algorithms for ranking and unranking (k, m)-ary trees in B-order," Journal of Combinatorial Optimization, Springer, vol. 0, pages 1-16.
  • Handle: RePEc:spr:jcomop:v::y::i::d:10.1007_s10878-019-00469-z
    DOI: 10.1007/s10878-019-00469-z
    as

    Download full text from publisher

    File URL: http://link.springer.com/10.1007/s10878-019-00469-z
    File Function: Abstract
    Download Restriction: Access to the full text of the articles in this series is restricted.

    File URL: https://libkey.io/10.1007/s10878-019-00469-z?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    As the access to this document is restricted, you may want to search for a different version of it.

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:spr:jcomop:v::y::i::d:10.1007_s10878-019-00469-z. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Sonal Shukla or Springer Nature Abstracting and Indexing (email available below). General contact details of provider: http://www.springer.com .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.