CHAPTER 8

image

Introduction to Binary Trees

In this chapter, we will explain the following:

  • The difference between a tree and a binary tree
  • How to perform pre-order, in-order, and post-order traversals of a binary tree
  • How to represent a binary tree in a computer program
  • How to build a binary tree from given data
  • What a binary search tree is and how to build one
  • How to write a program to do a word-frequency count of words in a passage
  • How to use an array as a binary tree representation
  • How to write some recursive functions to obtain information about a binary tree
  • How to delete a node from a binary search tree

8.1 Trees

A tree is a finite set of ...

Get Advanced Topics in Java: Core Concepts in Data Structures 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.