Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
1 . 1 D e f i n i n g Tr e e a n d H i e ra rc h i e s 3 Forest: a collection of separate trees. Yes, I am defining this term before we finally get to discussing trees. There are many equivalent ways to define a tree, and I want to spend some time with them. For now, let's say that it is a graph without any cycles. There are many more terms to describe special kinds of graphs, but frankly, we will not use them in this book. We are supposed to be doing SQL programming, not learning graph theory. The strength of graphs as problem-solving tools is that nodes and edges can be given extra attributes that adapt this general model to a particular problem. Edges can be assigned "weights," such as expected travel time for roads on a highway map. Nodes can be assigned "colors" that put them into groups, such as men and women. Look around and you will see how they are used. 1.1 Defining Tree and Hierarchies There is an important difference between a tree and a hierarchy, which has