Efficient Generation, Ranking, and Unranking of (k, m)-Ary Trees in B-Order
Peer reviewed, Journal article
Accepted version
View/ Open
Date
2019Metadata
Show full item recordCollections
Original version
Bulletin of the Iranian Mathematical Society. 2019, 45 (4), 1145-1158. 10.1007/s41980-018-0190-yAbstract
In this paper, we present a new generation algorithm with corresponding ranking and unranking algorithms for (k, m)-ary trees in B-order. (k, m)-ary tree is introduced by Du and Liu. A (k, m)-ary tree is a generalization of k-ary tree, whose every node of even level of the tree has degree k and odd level of the tree has degree 0 or m. Up to our knowledge no generation, ranking or unranking algorithms are given in the literature for this family of trees. We use Zaks’ encoding for representing (k, m)-ary trees and to generate them in B-order. We also prove that, to generate (k, m)-ary trees in B-order using this encoding, the corresponding codewords should be generated in reverse-lexicographical ordering. The presented generation algorithm has a constant average time and O(n) time complexity in the worst case. Due to the given encoding, both ranking and unranking algorithms are also presented taking O(n) and