Different shapes of AVL possible at height h Last Updated : 23 Jul, 2025 Comments Improve Suggest changes 35 Likes Like Report AVL Tree: It is a self-balancing Binary Search Tree where the Balance Factor cannot be more than one for all nodes. Balance Factor can be defined as the difference between heights of left and right subtree. Example: The task is to find the possible number of different shapes of a minimal AVL tree of height h can be formed. This can be understood by creating trees and then generating a generalized formula for this computation. Solution: Let N(h) denotes the number of possibilities of trees and h denotes the height of the AVL tree. In the figure below, possible trees are shaped along with their height. In the first column, height analysis is shown and in the second column, possible trees are shown. Let us now generalize the above observations: The formula can be generalized as: N(h) = 2 * N(h - 1) * N (h - 2) Create Quiz Comment I imsushant12 Follow 35 Improve I imsushant12 Follow 35 Improve Article Tags : DSA Technical Scripter 2020 AVL-Tree Data Structures Explore DSA FundamentalsLogic Building Problems 2 min read Analysis of Algorithms 1 min read Data StructuresArray Data Structure 3 min read String in Data Structure 2 min read Hashing in Data Structure 2 min read Linked List Data Structure 3 min read Stack Data Structure 2 min read Queue Data Structure 2 min read Tree Data Structure 2 min read Graph Data Structure 3 min read Trie Data Structure 15+ min read AlgorithmsSearching Algorithms 2 min read Sorting Algorithms 3 min read Introduction to Recursion 15 min read Greedy Algorithms 3 min read Graph Algorithms 3 min read Dynamic Programming or DP 3 min read Bitwise Algorithms 4 min read AdvancedSegment Tree 2 min read Binary Indexed Tree or Fenwick Tree 15 min read Square Root (Sqrt) Decomposition Algorithm 15+ min read Binary Lifting 15+ min read Geometry 2 min read Interview PreparationInterview Corner 3 min read GfG160 3 min read Practice ProblemGeeksforGeeks Practice - Leading Online Coding Platform 1 min read Problem of The Day - Develop the Habit of Coding 5 min read Like