Skip to main content

Questions tagged [avl-trees]

3 votes
1 answer
741 views

Assume I have a binary search tree, and I managed to prove that its height is upper bounded by $1.44 \log(n)$. Now, can I say with confidence that it is, for sure, an AVL tree? or is this condition ...
DaniDin's user avatar
  • 33
2 votes
1 answer
207 views

I have a question: given that an AVL tree holds numbers 1, 2, 3, ..., 1000, what are the smallest and largest possible values of the root? I have a feeling it is 500 and 501, but I don't know how to ...
HBH's user avatar
  • 21
0 votes
0 answers
98 views

I need to find a way to split an AVL tree based on the amount of nodes in the tree, lets assume you get a number $k$ and if the number of nodes in the tree is multiplication of $k$ you need to find ...
3xhaust's user avatar
0 votes
1 answer
114 views

I found an algorithm for determining if a binary tree is height-balanced. It Gets the height of left and right subtrees using dfs traversal. Return true if the difference between heights is not more ...
Ali Naseri's user avatar
0 votes
2 answers
145 views

If you were to define an altered AVL tree where the balance factor (the difference between the height of the left and right subtree) of a node must be less than or equal to the depth of the node (in ...
Remeraze's user avatar
1 vote
2 answers
472 views

Problem: we have a sequence of numeric values, e.g. [102, 25, 77, 17, 2, 13]. We need to implement 3 operations, each can be at most logarithmic time complexity. <...
YogoWafel's user avatar
0 votes
0 answers
659 views

How many ways can we insert elements { 1, 2, 3, .... 7 } to make an AVL tree so that it does not have any rotation? I broke it down into 2 cases: Case 1: height of tree = 2, (a complete binary tree) ...
Arun Madhav's user avatar
0 votes
1 answer
97 views

Looking at the tree on the left it seems that the triangles represent leaves of the avl tree. To arrive at the balancing of -2 besides the node y the right subtree must have 2 nodes while the left ...
Rubus's user avatar
  • 123
1 vote
1 answer
131 views

I'm required to describe an implementation of a data structure that holds key,value pairs, which can be signed integers. We need to be able to init() in O(1), insert(x) in O(logn), delete(x) in O(logn)...
sadcat_1's user avatar
  • 193
1 vote
1 answer
304 views

AVL trees are height balanced binary search trees. As a consequence of this balance, the height of an AVL tree is logaritmic in its number of nodes. Then, searching and updating AVL-trees can be ...
Hendrik Jan's user avatar
  • 31.5k
4 votes
1 answer
907 views

On the Wikipedia page for AVL trees, the time/space complexity for common operations is stated both for average case (in Big Theta) and worst case (in Big O) scenarios. I understand both Big O and Big ...
573hgkaf's user avatar
1 vote
1 answer
342 views

According to Wikipedia: An augmented tree can be built from a simple ordered tree, for example a binary search tree or self-balancing binary search tree, ordered by the 'low' values of the intervals. ...
Vectorizer's user avatar
0 votes
1 answer
601 views

I found an AVL tree implementation on the internet and experimented: For a tree with node count of 2^20, the minimal and maximal tree heights are 16 and 24. While these heights are lg(n)-ish, I am ...
Vectorizer's user avatar
0 votes
1 answer
463 views

What size is the largest AVL tree for which an insertion could trigger a double rotation?
jon pierre's user avatar
-1 votes
1 answer
126 views

One advantage claimed for scapegoat trees over other balanced trees like AVL or red-black(RB trees - just mentioning AVL henceforth) is not needing to store additional balance information. But can't ...
greybeard's user avatar
  • 1,194

15 30 50 per page