About 2,380,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 O (N) …

  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 (root). ...

  3. 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 increases per …

  4. AVL tree: difference between leaves' depths? - Stack Overflow

    Jun 27, 2018 · An AVL tree guarantees that "worst" case look up time is O (log (n)). And it guarantees that at most the height difference of any two subtree's is at most 1. But this does not guarantee that …

  5. 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 ancestors'

  6. 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.

  7. 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 most ~2 lg …

  8. Finding Height of a node in an AVL Tree for Balance Factor calculation

    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 (LST) - …

  9. How many maximum height AVL trees given height?

    Feb 25, 2019 · I am having some trouble finding a recursive formula for finding the number of maximum height AVL trees of height h. Height 0 has 1, height 1 has 2, height 2 has 4, height 3 has 8, etc. is …

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

    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 maximum/minimum …