0% found this document useful (0 votes)
10 views

Binary Tree

Uploaded by

hirasafdar53
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Binary Tree

Uploaded by

hirasafdar53
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Binary Tree

Definition:
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.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.
A Binary tree is an ordered, rooted tree. Some authors use rooted binary tree instead
of binary tree to emphasize the fact that the tree is rooted, but as defined above, a binary tree is
always rooted. Don't necessarily label the children as left and right either.

Types:
A Rooted binary tree has a root node and every node has at most two

children.

A Full binary tree (sometimes referred to as a proper, plane, or strict binary


tree) is a tree in which every node has either 0 or 2 children. Another way of
defining a full binary tree is a recursive definition. A full binary tree is either:

 A single vertex (a single node as the root node).


 A tree whose root node has two subtrees, both of which are full binary trees.

A Perfect binary tree is a binary tree in which all interior nodes


have two children and all leaves have the same depth or
same level (the level of a node defined as the number of edges or
links from the root node to a node). A perfect binary tree is a full
binary tree.

A Complete binary tree is a binary tree in which every level, except possibly the last, is
completely filled, and all nodes in the last level are as far left as
possible. It can have between 1 and 2 h nodes at the last level h. A
perfect tree is therefore always complete but a complete tree is not
always perfect. Some authors use the term complete to refer instead
to a perfect binary tree as defined above, in which case they call this
type of tree (with a possibly not filled last level) an almost
complete binary tree or nearly complete binary tree. A complete
binary tree can be efficiently represented using an array.

 The Infinite complete binary tree is a tree with levels, where for each level d the number of
existing nodes at level d is equal to 2d. The cardinal number of the set of all levels is (countably
infinite). The cardinal number of the set of all paths (the "leaves", so to speak) is uncountable,
having the cardinality of the continuum.

You might also like