The Wayback Machine - https://web.archive.org/web/20250114184412/https://www.geeksforgeeks.org/what-is-avl-tree-avl-tree-meaning/
Open In App

What is AVL Tree | AVL Tree meaning

Last Updated : 15 Mar, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

An AVL is a self-balancing Binary Search Tree (BST) where the difference between the heights of left and right subtrees of any node cannot be more than one.

 

KEY POINTS

  • It is height balanced tree
  • It is a binary search tree
  • It is a binary tree in which the height difference between the left subtree and right subtree is almost one
  • Height is the maximum depth from root to leaf

Characteristics of AVL Tree:

  • It follows the general properties of a Binary Search Tree.
  • Each subtree of the tree is balanced, i.e., the difference between the height of the left and right subtrees is at most 1.
  • The tree balances itself when a new node is inserted. Therefore, the insertion operation is time-consuming

Application of AVL Tree:

  • Most in-memory sets and dictionaries are stored using AVL trees.
  • Database applications, where insertions and deletions are less common but frequent data lookups are necessary, also frequently employ AVL trees.
  • In addition to database applications, it is employed in other applications that call for better searching.
  • Most STL implementations of the ordered associative containers (sets, multisets, maps and multimaps) use red-black trees instead of AVL trees.

Advantages of AVL Tree:

  • AVL trees can self-balance.
  • It also provides faster search operations.
  • AVL trees also have balancing capabilities with a different type of rotation
  • Better searching time complexity than other trees, such as the binary Tree.
  • Height must not be greater than log(N), where N is the total number of nodes in the Tree.

Disadvantages of AVL Tree:

  • AVL trees are difficult to implement
  • AVL trees have high constant factors for some operations.

Maximum & Minimum number of Nodes

Maximum number of nodes = 2H+1  – 1

Minimum number of nodes of height H = min no of nodes of height (H-1) + min no of nodes of height(H-2) + 1

where H(0)=1

              H(1)=2

What else can you read?

Unlock your potential with our DSA Self-Paced course, designed to help you master Data Structures and Algorithms at your own pace. In 90 days, you’ll learn the core concepts of DSA, tackle real-world problems, and boost your problem-solving skills, all at a speed that fits your schedule. With comprehensive lessons and practical exercises, this course will set you up for success in technical interviews and beyond.

And here's the challenge – join the Three 90 Challenge! Complete 90% of the course in 90 days, and you’ll earn a 90% refund. It's a great way to stay motivated, track your progress, and reward yourself for your dedication. Start the challenge today, and push your limits to achieve mastery in DSA!


Next Article
Practice Tags :

Similar Reads

three90RightbarBannerImg