next up previous
Next: Definition of Size Up: No Title Previous: Introduction

Definition of Binary Trees

There are many ways to model binary trees using sets and functions. For this example we will use a definition that relies on some Z notation for describing recursive data structures. The details of the syntax are not terribly important at this point, but you should understand the basic idea about building up trees from other trees.

Here is the definition:

zed54

It says that a tree is either a leaf or is made up of two subtrees glued together with node. Usually we would associate some data with the leaf and/or nodes, but for present purposes this simple definition will suffice.

Here are some examples of the kind of structures that we can build up using this definition:

displaymath114



Norman Papernick
Thu Mar 21 14:56:40 EST 1996