Skewed Binary Tree

In this lesson, we will discuss another type of Binary Tree-–a Skewed Binary Tree.

Introduction

A Skewed Binary Tree is a type of Binary Tree where all nodes are shifted to either the left or right side. It can also be defined as a Binary Tree in which the number of children is firmly restricted to one at each node. Furthermore, the side at which that single child node is present, either left or right, is also fixed throughout the tree. This type of Binary Tree structure is avoided at all cost, as we will have to perform n number of comparisons to search for a node, where n is the total number of nodes in the tree.

Types of Skewed Binary Tree

There are two types of Skewed Binary Trees based on which side is dominated:

  • Left-Skewed Binary Tree
  • Right-Skewed Binary Tree

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.