DEV Community

Aakash Yadav
Aakash Yadav

Posted on

1 1

Types of Trees in Data Structures

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.

Neon image

Serverless Postgres in 300ms (❗️)

10 free databases with autoscaling, scale-to-zero, and read replicas. Start building without infrastructure headaches. No credit card needed.

Try for Free →

Top comments (0)

Image of Quadratic

Free AI chart generator

Upload data, describe your vision, and get Python-powered, AI-generated charts instantly.

Try Quadratic free

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay