Binary Tree

Learn the fundamentals of binary trees.

Introduction to binary trees

The main reason we’re studying data structures is to organize data most efficiently. A binary tree is a specialized representation of data structure. A binary tree is used for data storage purposes. A tree is represented by nodes that are connected by edges or pointers.

A binary tree has a unique condition, making it very special among other data storage mechanisms. A node of a binary tree can have a maximum of two children. When it has one or two children, we call it a subtree. Each node of a subtree can have more subtrees.

When a tree node or subtree node doesn’t have children, it’s called ...