Space-Time Trade-offs in the Relative Unranking of Binary Trees
Chandra N. Sekharan · The Computer Journal · 1996
The set of binary trees with n internal vertices can be totally ordered using a number of different representations. There are Cn binary trees in any such order where Cn denotes the nth Catalan number. Given a total order on the set of binary trees with n internal vertices and an integer i, 1 ⩽ i ⩽ Cn, the unranking problem is to generate the binary tree whose ordinal number is i. Given a binary tree with T with ordinal number j < Cn and an integer i, 1 ⩽ i ⩽ Cn - j, a slight generalization of the unranking problem, called the relative unranking problem, is to find the binary tree with ordinal number i relative to T. The relative unranking problem is motivated by its application to computing a Steiner minimal tree in parallel. In this paper, a computationally efficient algorithm for solving the relative unranking problem is presented. The algorithm is based on a certain directed graph, called the feasible suffix graph, whose combinatorial properties are of independent interest. One of the salient features of the algorithm is that the unranking time can be traded for space. Computational experience with the algorithm is reported.