tree-types

Types of Trees in Data Structure based on the number of children:

1. Binary Tree

Each element in a binary tree can have only 2 children.

Types of Binary Tree:

Binary Tree consists of following types based on the number of children:

  1. Full Binary Tree

  2. Degenerate Binary Tree

On the basis of completion of levels, the binary tree can be divided into following types:

  1. Complete Binary Tree

  2. Perfect Binary Tree

  3. Balanced Binary Tree

2. Ternary Tree

Each node has at most three child nodes, usually distinguished as “left”, “mid” and “right”.

3. N-ary Tree (Generic Tree)

  1. Many children at every node.

  2. The number of nodes for each node is not known in advance.

Special Types of Trees in Data Structure based on the nodes’ values:

1. Binary Search Tree

Properties:

  1. Left node is lesser than root node

  2. Right node is greater than the root node

  3. The left and right subtree each must also be a binary search tree

2. AVL Tree

Properties:

AVL tree is a self-balancing Binary Search Tree (BST) where the difference between heights of left and right subtrees for any node cannot be more than one.

3. Red-Black Tree

4. B-Tree

5. B+ Tree

6. Segment Tree

Last updated