Tree Data Structure Children
Tree Data Structure Children
Level - The level of a node is defined by 1 + the number of connections between the node and the root.
Height - The height of a node is the length of the longest downward path between the root and a leaf.
A binary tree is a tree data structure in which each node has at most two children, which are referred to as
the left child and the right child.
A rooted binary tree is a tree with a root node in which every node has at most two children.
A full binary tree (sometimes 2-tree or strictly binary tree) is a tree in which every node other than the
leaves has two children. A full tree is sometimes ambiguously defined as a perfect tree. Physicists define
a binary tree to mean a full binary tree.
A proper binary tree is an ordered tree in which each internal node has exactly two children.
A perfect binary tree is a full binary tree in which all leaves have the same depth or same level, and in
which every parent has two children.[18] (This is ambiguously also called a complete binary tree (see next).)
An example of a perfect binary tree is the ancestry chart of a person to a given depth, as each person has
exactly two biological parents (one mother and one father); note that this reverses the usual parent/child
tree convention, and these trees go in the opposite direction from usual (root at bottom).
A complete binary tree is a binary tree in which every level, except possibly the last, is completely
filled, and all nodes are as far left as possible.[19] A tree is called an almost complete binary tree or nearly
complete binary tree if the exception holds, i.e. the last level is not completely filled. This type of tree is used
as a specialized data structure called a heap.