Java Reference
In-Depth Information
chapter
18
trees
T he tree is a fundamental structure in computer science. Almost all operat-
ing systems store files in trees or treelike structures. Trees are also used in
compiler design, text processing, and searching algorithms. We discuss the
latter application in Chapter 19.
In this chapter, we show
A definition of a general tree and discuss how it is used in a file system
n
An examination of the binary tree
n
Implementation of tree operations, using recursion
n
Nonrecursive traversal of a tree
n
general trees
18.1
Trees can be defined in two ways: nonrecursively and recursively. The nonre-
cursive definition is the more direct technique, so we begin with it. The recur-
sive formulation allows us to write simple algorithms to manipulate trees.
 
 
 
Search WWH ::




Custom Search