Chapter 29
Trees
"I think that I shall never see
A poem as lovely as a tree." - Joyce Kilmer
In this chapter you will learn about the concept of a tree as they are known in Computer Science. While we will not be writing poems about them, we will construct some lovely code to provide efficient implementations of some Abstract Data Type (ADT).
29.1 General Trees
Chapter 25 introduced the concept of the linked structure using the simplest form of a linked list. The most general expression of a linked structure is the graph that was briefly presented in chapter 28. A tree is a linked structure that falls somewhere between these two extremes. Like the other two, a tree is formed of nodes with edges between them. We consider these edges to have a direction, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access