DEV Community


Types of Trees in Data Structures

Aakash Yadav
I am a Full Stack Developer ( Django + Bootstrap+Android ). I also work on projects related to IOT. I also love competitive programming.
・2 min read

Today, we are going to learn the types of trees in tree Data Structure. So let's get started.

1. Binary Tree:

These types of trees have 0,1 or 2 nodes as children nodes.

2.Full or Strict Binary Tree:

Strict or Full Binary Tree are the trees which either have 0 or 2 children

3. Almost Complete Binary Tree :

Almost complete trees are the trees which first towards left and then right. Also they prefer staying on same level first. They fill left right and then move onto the next level.

4. Complete Binary Tree

Last level can be incomplete, but all level (also it's filled from left).

At some places, they write complete and perfect binary tree as same.

5. Perfect Binary Tree :

Perfect Binary Tree is a binary tree in which all the internal nodes have two children and all leaf nodes are at the same level.

6.Binary Search Tree (BST):

The binary tree in which all the elements are filled according to this rule:

each node must have a child smaller then itself in left node and greater value in right node.

7. Skewed Binary Tree:

They have one or zero child node and elements are either added in ascending or descending order in the Binary Search tree to get this tree.

Discussion (0)