Introduction to Binary Trees
Explore the fundamental concepts of binary trees, including their structure, node relationships, and terminology such as root, parent, child, depth, height, and leaves. Understand how binary trees are represented and analyzed in data structures to build a solid foundation for more advanced topics.
We'll cover the following...
Binary trees overview
This section introduces one of the most fundamental structures in computer science: binary trees. The use of the word tree here is from when we draw them out, the resultant drawing often resembles the trees found in a forest. There are many ways of defining binary trees. Mathematically, a binary tree is a connected, undirected, finite graph with no cycles, and no vertex of degree greater than three.
For most computer science applications, binary trees are rooted: a special node, r, of degree at most two is called the root of the tree. For every node, ...