2. Trees, Heaps, and Graphs
Learning Objectives
By the end of this chapter, you will be able to:
- Analyze and identify where non-linear data structures can be used
- Implement and manipulate tree structures to represent data and solve problems
- Traverse a tree using various methods
- Implement a graph structure to represent data and solve problems
- Represent a graph using different methods based on a given scenario
In this chapter, we will look at two non-linear data structures, namely trees and graphs, and how they can be used to represent real-world scenarios and solve various problems.