A binary tree is a tree data structure where each node has a left and a right child.
or
children.
and
nodes where
is the height of the tree.
.
in a full binary tree is at least
and at most
where
is the height of the tree. A tree with only a root node has a height of
.
in a perfect binary tree is
because the number of non-leaf (internal) nodes is
.
leaves has
nodes.
A binary tree can be represented using an array data structure. In case the tree is complete then this method does not waste any space.
The index of the left-node is given by:
The index of the right-node is given by:
The index of the parent of a node is given by:
where:
is the largest interger less than or equal to
.For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.