scispace - formally typeset
Journal ArticleDOI

A numbering system for binary trees

Gary D. Knott
- 01 Feb 1977 - 
- Vol. 20, Iss: 2, pp 113-115
TLDR
A function and its inverse below which realize the binary tree numbering system just described are presented and are only concerned with the "shape" of a binary tree.
Abstract
corresponding to p. The function rank must be in-vertible so that p can be obtained from rank(p). Moreover , it is desirable that the range of rank be a segment of consecutive integers and that rank preserve a natural binary tree ordering. Such a function allows an n-node binary tree to be represented as a single integer. This saving of space and collapsing of structure is sometimes convenient. It also can be used to generate all n-node binary trees or a random n-node binary tree. The use of such a function for these purposes, must be balanced, however, against the possibility that both derived schemes may be inferior to other more specialized methods. We present a function and its inverse below which realize the binary tree numbering system just described. We are only concerned with the \"shape\" of a binary tree. Any labels of the nodes are irrelevant. Thus the 14 distinct 4-node binary trees may be given in order as: \\ 1 2 3 4 5 6 7

read more

Citations
More filters
Journal ArticleDOI

Lexicographic generation of ordered trees

TL;DR: A one-one correspondence between all the regular binary trees with n internal nodes and certain integer sequences, an algorithm for generating these trees lexicographically, and the ranking function and the corresponding unranking procedure is shown.
Journal ArticleDOI

Un procédé itératif de dénombrement d'arbres binaires et son application à leur génération aléatoire

TL;DR: Presentation d'une methode de type geometrique pour denombrer les arbres binaires de taille n d'interesse d'abord a un type d'objets plus complexes les ar Binaires a feuilles numerotees.
Journal ArticleDOI

The complexity of drawing trees nicely

TL;DR: There is no obvious “principle of optimality” that can be applied, since globally narrow, aesthetic placements of trees may require wider than necessary subtrees, and the problem is NP-hard.
Journal ArticleDOI

Generation of Binary Trees from Ballot Sequences

TL;DR: An efficient algorithm for generating and indexing all shapes of n-noded binary trees is described, based on a correspondence between binary trees and the class of stack-sortable permutations.

Program Inversion

TL;DR: It is shown that inversion establishes a natural relationship between various well known programs, e.g. sorting and permutation generation programs.
References
More filters
Book

The Art of Computer Programming

TL;DR: The arrangement of this invention provides a strong vibration free hold-down mechanism while avoiding a large pressure drop to the flow of coolant fluid.