15. Trees
CAUTION - CHAPTER UNDER CONSTRUCTION!
This chapter was last updated on January 16, 2025.
A tree is a connected graph that contains no simple circuits. Trees are used to model decisions, to sort data, and to optimize networks.
Key terms and concepts covered in this chapter:
-
Trees
-
Properties
-
trees (binary, spanning)
-
expression trees
-
-
Traversal strategies
-
Spanning trees/forests
-
Spanning trees
-
tree traversals
15.1. Definitions, Examples, and Properties of Trees and Forests
A tree is a simple graph \(T\) that is connected and has no cycles (that is, there is no trail in \(T\) that starts and ends at the same vertex.)
A forest is the union of several trees. A forest is a simple graph that has one or more connected components, where each connected component is a tree.

The image shows a forest composed of \(3\) trees. Notice that for any two vertices in one of the trees, there is only one simple path that joins the vertices. This is True for every tree.
15.2. Additional Topics
Students in CSC 230 Fall 2024 should refer to the slide decks posted in Canvas.
-
Spanning Trees and Spanning Forests
-
Kruskal’s Algorithm
-
-
Binary Trees
-
Tree Traversal Strategies
-
Expression Trees
-
-
Algorithms for Binary search trees
-
Algorithms for Depth- and breadth-first traversals
-