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

Types of Binary Tree

types-of-binary-tree

Uploaded by

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

Types of Binary Tree

types-of-binary-tree

Uploaded by

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

Types of Binary Tree

A binary tree is a tree data structure composed of nodes, each of which has at most, two
children, referred to as left and right nodes. Let us understand 5 types of Binary Tree
through definitions and with their valid-invalid structures.

1. Full Binary Tree


Full Binary Tree is a Binary Tree in which every node has 0 or 2 children.

Side Note: For Full Binary Tree, the following equation is always true.
Number of Leaf nodes = Number of Internal nodes + 1

2. Complete Binary Tree


It is a binary tree in which every level, except possibly the last, is completely filled, and
all nodes are as far left as possible.

Side Note: Binary Heap is an important use case of Complete Binary tree.
3. Perfect Binary Tree
Perfect Binary Tree is a Binary Tree in which all internal nodes have 2 children and all
the leaf nodes are at the same depth or same level.
Side Note: Total number of nodes in a Perfect Binary Tree with height H is 2^H — 1.

4. Balanced Binary Tree


Balanced Binary Tree is a Binary tree in which the height of the left and the right
subtrees of every node may differ by at most 1.

Side Note: AVL Tree and Red-Black Tree are well-known data structures to
generate/maintain Balanced Binary Search Tree. Search, insert and delete operations
cost O(log n) time in that. We will discuss about both of them later in the course.
5. Degenerate Binary Tree
It is a tree where each parent node has only one child node. It behaves like a linked list.

Side Note: Height of a Degenerate Binary Tree is equal to Total number of nodes in that
tree.

You might also like