Select Page

# Difference between Binary Search Tree and AVL Tree

Team 1 - Programming
Published: January 8, 2023

## Binary Search Tree:

A binary search tree is also called an ordered or sorted binary tree because the in-order traversal of binary search tree is always in sorted order.

A binary search tree is a binary tree with only two branches in which each node of the left subtree is less than or equal and each node in the right subtree is greater. A binary Search Tree is a node-based binary tree data structure. We can perform preorder, in-order, and post-order traversal using the Binary Search tree.

## AVL Tree:

AVL tree is a self-balancing Binary Search Tree where the difference between heights of left and right subtrees cannot be more than 1 for all nodes. This difference is called the Balance Factor i.e. 0, 1, and -1.

In order to perform this balancing, we perform the following rotations on the unbalanced/imbalanced Binary Search Tree to make it an AVL tree.

• Left Rotation
• Right Rotation
• Left Right Rotation
• Right Left Rotation

## Following are the Difference between Binary Search Tree and AVL Tree

Source: www.geeksforgeeks.org