Available at: https://digitalcommons.calpoly.edu/theses/3457
Date of Award
12-2027
Degree Name
MS in Computer Science
Department/Program
Computer Science
College
College of Engineering
Advisor
Daniel Frishberg
Advisor Department
Computer Science
Advisor College
College of Engineering
Abstract
The Catalan numbers count many families of combinatorial objects, including binary trees, Dyck paths, polygon triangulations and noncrossing arc diagrams. Although the bijections among these structures appear throughout the literature, explicit and efficient algorithms for computing them are not collected in one place. This thesis presents algorithms that convert one Catalan structure into another by routing the conversions through a tree, and extends this approach to full 𝑘-ary trees, counted by the Fuss–Catalan numbers. The cycle lemma yields a linear-time procedure for sampling a uniformly random full 𝑘-ary tree. Each conversion between a tree and another structure also runs in linear time, and a diagonal flip in a triangulation corresponds to a tree rotation that runs in constant time. Proofs of correctness, along with running-time and space bounds, accompany every algorithm. These algorithms form the basis of Catalan Toolbox, a C++ command-line tool that samples random Catalan objects, enumerates all objects of a given size for 𝑘=2 (including pattern-avoiding binary trees) and carries out operations such as diagonal flips. The toolbox also includes a Python visualizer that draws one object in all its forms side by side, for use in research and in the classroom.