File:Binary_tree_v2.svg · Wikimedia Commons · See Wikimedia Commons
binary tree
Sign in to savetree data structure in which each node has at most two children
Wikidata facts
- Instance of
- abstract data type
- Image
- Binary tree.svg
- Has parts of class
- edge
Show 6 more facts
- Stack Exchange tag
- stackoverflow.com/tags/binary-tree
- Commons category
- Binary trees
- topic's main category
- Category:Binary trees
- studied by
- graph theory
- different from
- B-tree
- maintained by WikiProject
- WikiProject Mathematics
via Wikidata · CC0
~27 min read
Encyclopedic overview
A labeled binary tree of size 9 (the number of nodes in the tree) and height 3 (the height of a tree defined as the number of edges or links from the top-most or root node to the farthest leaf node), with a root node whose value is 1. The above tree is unbalanced and not sorted.
In computer science, a binary tree is a tree data structure in which each node has at most two children, referred to as the left child and the right child. That is, it is a k-ary tree where k = 2. A recursive definition using set theory is that a binary tree is a triple (L, S, R), where L and R are binary trees or the empty set and S is a singleton (a single–element set) containing the root.
Excerpted from Wikipedia’s “binary tree” article, available under the CC BY-SA 4.0 licence.