Logo Data Structures and Algorithms with Object-Oriented Design Patterns in C++
next up previous contents index

Terminology

Consider a tree tex2html_wrap_inline63410, tex2html_wrap_inline59063, as given by Definition gif.

Clearly the terminology used for describing tree data structures is a curious mixture of the mathematical, the genealogical, and the botanical. There is still more terminology to be introduced, but in order to do that, we need the following definition:

Definition (Path and Path Length)  Given a tree T containing the set of nodes R, a path in T is defined as a non-empty sequence of nodes

displaymath63448

where tex2html_wrap_inline63492, for tex2html_wrap_inline63494 such that the tex2html_wrap_inline58387 node in the sequence, tex2html_wrap_inline63458, is the parent of the tex2html_wrap_inline63500 node in the sequence tex2html_wrap_inline63502. The length of path P is k-1.

For example, consider again the tree tex2html_wrap_inline63428 shown in Figure gif. This tree contains many different paths. In fact, if you count carefully, you should find that there are exactly 29 distinct paths in tree tex2html_wrap_inline63428. This includes the path of length zero, tex2html_wrap_inline63512; the path of length one, tex2html_wrap_inline63514; and the path of length three, tex2html_wrap_inline63516.


next up previous contents index

Bruno Copyright © 1997 by Bruno R. Preiss, P.Eng. All rights reserved.