7.4: Implementing Binary Trees

This section introduces three ways to implement a binary tree.

1. Using an array of records with just an information field

2. Using records with an information field and left and right pointer fields linked together via their pointer fields

3. Using a list-structure

Chapter 8 contains an application of the first implementation. A program using the second implementation, with the records stored in dynamic memory, is included. The program specifies the details of this important representation and illustrates how to create and process binary trees and how to test functions developed in the earlier examples.

7.4.1 Sequential Representation

7.4.2 Linked Representation

7.4.3 List-structure Representation