O'Reilly logo

Introducing Data Structures with Java by David Cousins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12

Binary Trees

  Trees

Contents

  • Binary tree structures
  • Search trees
  • Tree operations—build, search, traverse, delete items
  • A Tree class
  • Threaded trees
  • Expression trees
  • Heaps
12.1 INTRODUCTION

Each node in a singly linked list, stack or queue is linked to just one another, so that each points to its successor (in the doubly linked list an item points to its predecessor too). In the structure considered in this chapter, each node can be linked to one or more others. In the case of a ‘binary tree’, each node may be linked to a maximum of two others: A node has two links to its ‘left’ and ‘right’ children, it being their ‘parent’. Each child can ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required