Skip to main contentSkip to search
Episciences
Open Access Journals
Sign in(new window)
Discrete Mathematics & Theoretical Computer Science logo
Discrete Mathematics & Theoretical Computer Science
Discrete Mathematics & Theoretical Computer Science logo
Discrete Mathematics & Theoretical Computer Science
Sign in(new window)
Articles & Issues
All articlesAll accepted articlesAll volumesLast volumeSectionsSpecial issuesAuthors
About
The journalIndexing
Boards
Publish
For authorsEthical charter
Submit
Discrete Mathematics & Theoretical Computer Science logo
Contact
|
Credits
eISSN 1365-8050
|
RSS
|
Atom
Episciences
Documentation
|
Acknowledgements
|
Publishing policy
Accessibility: non-compliant
|
Legal mentions
|
Privacy statement
|
Terms of use
  1. Home > Articles & Issues >
  2. Articles >
  3. Holonomic equations ...
Article

Holonomic equations and efficient random generation of binary trees

Pierre Lescanne ORCID (1) (2)
(1) Laboratoire de l'Informatique du Parallélisme
(2) Preuves et Langages
Download article
Open on HAL
Submitted on
January 23, 2024
Accepted on
July 7, 2023
Published on
February 23, 2024
Last modified on
April 1, 2025
Volume 25
vol. 25:2
DOI
10.46298/dmtcs.10952
License
Attribution 4.0 International (CC BY 4.0)
Indicators
712
Views
691
Downloads

Holonomic equations and efficient random generation of binary trees

Pierre Lescanne ORCID (1) (2)
(1) Laboratoire de l'Informatique du Parallélisme
(2) Preuves et Langages
Abstract
Holonomic equations are recursive equations which allow computing efficiently numbers of combinatoric objects. Rémy showed that the holonomic equation associated with binary trees yields an efficient linear random generator of binary trees. I extend this paradigm to Motzkin trees and Schröder trees and show that despite slight differences my algorithm that generates random Schröder trees has linear expected complexity and my algorithm that generates Motzkin trees is in O(n) expected complexity, only if we can implement a specific oracle with a O(1) complexity. For Motzkin trees, I propose a solution which works well for realistic values (up to size ten millions) and yields an efficient algorithm.
Keywords
  • [INFO.INFO-CC]Computer Science [cs]/Computational Complexity [cs.CC]
  • [INFO.INFO-DS]Computer Science [cs]/Data Structures and Algorithms [cs.DS]
  • combinatorics
  • random generation
  • Motzkin number
  • Catalan number
  • binary tree
  • unary-binary tree
  • Schroeder number
  • combinatorics random generation Motzkin number Catalan number binary tree unary-binary tree
Mathematics Subject Classification 2020
  • 05C05 - Trees
Preview
Loading PDF preview...