English

An algorithm for generating random mixed-arity trees

Discrete Mathematics 2021-12-30 v2 Data Structures and Algorithms Combinatorics

Abstract

Inspired by [4] we present a new algorithm for uniformly random generation of ordered trees in which all occuring outdegrees can be specified by a given sequence of numbers. The method can be used for random generation of binary or n-ary trees, or ones with various arities. We show that the algorithm is correct and has O(n)O(n) time complexity for nn being the desired number of nodes in the resulting tree. In the discussion part we show how some selected formulas can be derived with the use of ideas developed in the proof of correctness of the algorithm.

Keywords

Cite

@article{arxiv.2112.12019,
  title  = {An algorithm for generating random mixed-arity trees},
  author = {Aleksander Kiryk},
  journal= {arXiv preprint arXiv:2112.12019},
  year   = {2021}
}

Comments

5 pages, 1 figure, 1 algorithm