Chapter 7. Concepts of Tree

We have already seen data structures such as linked list and array. They represent data stored in a linear fashion. In this chapter, we will discuss a new kind of data structure, called a tree. A tree is a generalization of a linked list. While a linked list node has one reference to the next node, a tree node has references to possibly more than one next node. These next nodes are called children of the node, and the node holding the references to the children is called a parent node. In this chapter, we will explore the following topics:

  • Concept of a tree as a data structure
  • Concept of a tree as an ADT
  • Binary trees
  • Different kinds of tree traversals
  • Tree search algorithms

So, let's jump into it right away.

A tree data structure ...

Get Java 9 Data Structures and Algorithms now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.