English

Efficient random sampling of binary and unary-binary trees via holonomic equations

Data Structures and Algorithms 2018-02-20 v2 Combinatorics

Abstract

We present a new uniform random sampler for binary trees with nn internal nodes consuming 2n+Θ(log(n)2)2n + \Theta(\log(n)^2) random bits on average. This makes it quasi-optimal and out-performs the classical Remy algorithm. We also present a sampler for unary-binary trees with nn nodes taking Θ(n)\Theta(n) random bits on average. Both are the first linear-time algorithms to be optimal up to a constant.

Keywords

Cite

@article{arxiv.1401.1140,
  title  = {Efficient random sampling of binary and unary-binary trees via holonomic equations},
  author = {Axel Bacher and Olivier Bodini and Alice Jacquot},
  journal= {arXiv preprint arXiv:1401.1140},
  year   = {2018}
}
R2 v1 2026-06-22T02:39:51.322Z