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.

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

AWS GenAI LIVE!

GenAI LIVE! is a dynamic live-streamed show exploring how AWS and our partners are helping organizations unlock real value with generative AI.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️