Sunday, January 29, 2023
HomeSoftware DevelopmentDistinction between Binary Search Tree and AVL Tree

# Distinction between Binary Search Tree and AVL Tree

## Binary Search Tree:

A binary search tree can also be known as an ordered or sorted binary tree as a result of the in-order traversal of binary search tree is all the time in sorted order.

A binary search tree is a binary tree with solely two branches by which every node of the left subtree is lower than or equal and every node in the correct subtree is larger. A binary Search Tree is a node-based binary tree knowledge construction. We are able to carry out preorder, in-order, and post-order traversal utilizing the Binary Search tree.

## AVL Tree:

AVL tree is a self-balancing Binary Search Tree the place the distinction between heights of left and proper subtrees can’t be greater than 1 for all nodes. This distinction is named the Steadiness Issue i.e. 0, 1, and -1.

With a view to carry out this balancing, we carry out the next rotations on the unbalanced/imbalanced Binary Search Tree to make it an AVL tree.

• Left Rotation
• Proper Rotation
• Left Proper Rotation
• Proper Left Rotation

RELATED ARTICLES