Generating t-ary trees in A-order
Two ‘natural’ orders have been defined on the set of t-ary trees. Zaks (1980) referred to these orders as A-order and B-order. Many algorithms have been developed for generating binary and t-ary trees in B-order. Here we develop an algorithm for generating all t-ary trees with n nodes in (reverse) A...
Gespeichert in:
Veröffentlicht in: | Information processing letters 1988-04, Vol.27 (4), p.205-213 |
---|---|
Hauptverfasser: | , |
Format: | Artikel |
Sprache: | eng |
Schlagworte: | |
Online-Zugang: | Volltext |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
Zusammenfassung: | Two ‘natural’ orders have been defined on the set of
t-ary trees. Zaks (1980) referred to these orders as A-order and B-order. Many algorithms have been developed for generating binary and
t-ary trees in B-order. Here we develop an algorithm for generating all
t-ary trees with
n nodes in (reverse) A-order, as well as ranking and unranking algorithms. The generation algorithm produces each tree in constant average time. The analysis of the generation algorithm makes use of an interesting bijection on the set of
t-ary trees. The ranking algorithm runs in O(
tn) time and the unranking algorithm in O(
tn lg
n) time. |
---|---|
ISSN: | 0020-0190 1872-6119 |
DOI: | 10.1016/0020-0190(88)90027-0 |