Tech moves fast! Stay ahead of the curve with Techopedia!
Join nearly 200,000 subscribers who receive actionable tech insights from Techopedia.
A binary tree is a tree data structure where each node has up to two child nodes, creating the branches of the tree. The two children are usually called the left and right nodes. Parent nodes are nodes with children, while child nodes may include references to their parents.
A binary tree is made up of at most two nodes, often called the left and right nodes, and a data element. The topmost node of the tree is called the root node, and the left and right pointers direct to smaller subtrees on either side.
Binary trees are used to implement binary search trees and binary heaps. They are also often used for sorting data as in a heap sort.