© Elshad Karimov 2020
E. KarimovData Structures and Algorithms in Swifthttps://doi.org/10.1007/978-1-4842-5769-2_10

10. Binary Tree

Elshad Karimov1 
(1)
New York, New York, USA
 

In the previous chapter, you have learned about the basic tree structure where each node can have unlimited children. Binary trees are tree data structures in which each node has at most two children, often referred to as the left and right children. In this chapter, you will learn the main properties of binary data structure and how to implement it.

Binary Tree Primer

The basic structure of a binary tree is shown in Figure 10-1.
../images/490882_1_En_10_Chapter/490882_1_En_10_Fig1_HTML.png
Figure 10-1

Basic binary tree

Before continuing to ...

Get Data Structures and Algorithms in Swift: Implement Stacks, Queues, Dictionaries, and Lists in Your Apps 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.