Fast Enumeration, Ranking, and Unranking of Binary Trees
Andrzej Proskurowski, Ekaputra Laiman
Committee:
Technical Report(May 1982)
Keywords: None

A linear representation of binary trees proposed earlier is analyzed with respect to the complexity of ranking and unranking operations. Simple algorithms are given that perform these operations in time proportional to the order of the binary tree, provided that a table of values of certain integer function is precomputed. Also, the complexity of generating representations of all binary trees of given order is discussed. An algorithm is given which updates the representation of a tree to yield the representation of the next tree in a time averaging to a constant over all generated binary trees. The larger the order of the generated trees, the smaller the constant.