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

Terminology

Consider a tree tex2html_wrap_inline62288, tex2html_wrap_inline57996, 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

displaymath62326

where tex2html_wrap_inline62370, for tex2html_wrap_inline62372 such that the tex2html_wrap_inline57340 node in the sequence, tex2html_wrap_inline62336, is the parent of the tex2html_wrap_inline62378 node in the sequence tex2html_wrap_inline62380. The length of path P is k-1.

For example, consider again the tree tex2html_wrap_inline62306 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_inline62306. This includes the path of length zero, tex2html_wrap_inline62390; the path of length one, tex2html_wrap_inline62392; and the path of length three, tex2html_wrap_inline62394.


next up previous contents index

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