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

Terminology

Consider a tree tex2html_wrap_inline62555, tex2html_wrap_inline58277, as given by Definition gif.

Clearly the terminology used for describing tree data structures is a curious mixture of mathematics, genealogy, and botany. 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

displaymath62593

where tex2html_wrap_inline62637, for tex2html_wrap_inline62639 such that the tex2html_wrap_inline57621 node in the sequence, tex2html_wrap_inline62603, is the parent of the tex2html_wrap_inline62645 node in the sequence tex2html_wrap_inline62647. The length of path P is k-1.

For example, consider again the tree tex2html_wrap_inline62573 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_inline62573. This includes the path of length zero, tex2html_wrap_inline62657; the path of length one, tex2html_wrap_inline62659; and the path of length three, tex2html_wrap_inline62661.


next up previous contents index

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