About 2,400,000 results
Open links in new tab
  1. algorithm - Red-black tree over AVL tree - Stack Overflow

    Dec 13, 2012 · The balance factor stored in each node of an AVL tree is two bits (-1 / 0 / +1). A red-black tree stores one bit of color information in each node. Thus in total both trees require …

  2. How do I get the height of an AVL tree? - Stack Overflow

    Dec 8, 2018 · This is my AVL tree class: public class AVLTree1 { // Each AVLtree object is (a header of) an AVL-tree. // This AVL-tree is represented simply by a reference to its root node …

  3. Difference between red-black trees and AVL trees

    Mar 2, 2016 · AVL trees maintain a more rigid balance than red-black trees. The path from the root to the deepest leaf in an AVL tree is at most ~1.44 lg (n+2), while in red black trees it's at …

  4. Finding Height of a node in an AVL Tree for Balance Factor …

    Jan 14, 2022 · 0 AVL tree is a binary search tree that is balanced i.e height = O (log (n)). This is achieved by making sure every node follows the AVL tree property: Height of the left subtree …

  5. data structures - Finding the minimum and maximum height in a …

    Jun 11, 2015 · Is there a formula to calculate what the maximum and minimum height for an AVL tree, given a certain number of nodes? For example: Textbook question: What is the …

  6. data structures - AVL tree vs. B-tree - Stack Overflow

    Apr 29, 2010 · An AVL tree is a self-balancing binary search tree, balanced to maintain O (log n) height. A B-tree is a balanced tree, but it is not a binary tree. Nodes have more children, which …

  7. How to find the maximum height of an AVL tree with n nodes?

    Dec 18, 2023 · The first thing that came up to me was that the height of an avl tree must b smaller than 1.45log2 (n). So using this formula with n = 23 i got something like 6.5, 7 if rounded up.

  8. java - Minimum number of node in AVL tree? - Stack Overflow

    Jan 25, 2014 · Min nodes in avl tree with height h are when it has a balancing factor of either 1 or-1. In that kind of avl tree One sub tree has height h-1 and other sub tree's height is h-2.

  9. How do you know where to perform rotations in an AVL tree?

    The idea behind AVL trees is that globally rebalancing the tree can be done by iteratively applying local rotations. In other words, when you do an insertion or deletion and need to do tree …

  10. How to implement insertion for AVL tree without parent pointer?

    I saw some articles about the implementation of AVL's rebalance() function. After each insertion, we should check the insertion Node's ancestors for balance. So I think, in order to check …