Questions tagged [avl-trees]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1
votes
0answers
40 views

Modifying insert and remove functions of an AVL tree so that nodes that don't need to be rebalanced are not checked for balance

Trying to modify an insert and remove function for an AVL Tree so that no nodes are checked for balance that do not need to be. The suggested way to do was was to change the return types of insert, ...
0
votes
2answers
58 views

is AVL tree is better than heap for sorting purpose?

for sorting n elements what is better to use AVL tree or heap data structure and why? Can someone explain in brief?
0
votes
0answers
20 views

Starting with an initially empty AVL-tree, draw the resulting AVL-tree after insertion

Starting with an initially empty AVL-tree, draw the resulting AVL-tree after inserting the following elements one after another. 50, 70, 30, 10, 20, 15. I'm not sure if I am doing it correctly since ...
1
vote
1answer
69 views

How to prove that in an AVL tree with height h, the depth of every leaf node is at least $\lceil h/2 \rceil$

I have an AVL tree with height h. I understand how to get h $\thickapprox$ 1.440 log N. However, I can't figure out how to calculate the minimum depth of a leaf node from root. I tried constructing a ...
0
votes
1answer
19 views

AVL tree balance property states for the two subtrees of a node, their height can differ at most one. Why can't it be zero?

I was thinking that if they were equal, say they are required to be zero this would be enforce the balance property more effectively. Can anyone explain why 1 is a satisfactory rather than just them ...
-1
votes
1answer
48 views

Is the following a AVL tree? [closed]

I have a tree as Is it an AVL tree? it seems to balanced for me.
0
votes
0answers
32 views

Finding rank of newly inserted node in AVL tree augmented with rank of node

My prof was talking about how to augment a tree to efficiently find the key with a given rank. On the way to getting the right answer (store the size of the subtree rooted at each node), he proposed ...
1
vote
1answer
190 views

AVL Tree - Print ascending using in-order

Trying to understand how to write proof of correctness. Searched over the internet on how to write proof of correctness but can't find a good solution for it. The following sorting algorithm is ...
2
votes
0answers
92 views

Optimizing AVL Tree operations for sequential data

I'm working on an implementation of a data structure that needs a tree-like data structure for accelerating look-ups. The interesting part about this data structure is that the only operations on the ...
0
votes
0answers
92 views

How to create an AVL tree, given it's pre-order traversal?

Given the pre-order traversal, we can easily obtain the necessary Binary Search Tree(BST- not necessarily balanced). However, the problem arises when we have to decide the balancing manually(this was ...
1
vote
1answer
68 views

Is it possible to balance a already constructed un-balanced AVL tree, with no prior information of last insert?

Im learning about tree data structures, and had a question that i couldnt find answer to so I came here. Usually when we balance a tree, we insert keys and keep checking balance factor, as soon as it ...
1
vote
1answer
471 views

AVL tree worst case height proof

The worst case height of AVL tree is $1.44 \log n$. How do we prove that? I read somewhere about Fibonacci quicks but did not understand it.
0
votes
1answer
53 views

avl trees rotations question

As you can see in this tree its unbalanced at the root with a balanced factor of $-2$. You can also perform a Right left rotation or a Right Right rotation. Which do you have to pick in this case?
0
votes
0answers
115 views

How many maximum height AVL trees given height?

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 that ...
2
votes
2answers
184 views

How do I know which direction I should rotate a node in an AVL Tree?

I'm studying AVL Trees in my programming class and we got this exercise dealing with right, left, left-right and right-left rotations as a way to check if we understand the theoretical concept of AVL ...
1
vote
1answer
63 views

AVL Rotations Abbreviations

I read that there are 4 types of rotations: Left rotation Right rotation Left-Right rotation Right-Left rotation What are the corresponding abbreviations: RL,LR,RR,LL? Is there a reference how to ...
22
votes
1answer
4k views

AVL trees are not weight-balanced?

In a previous question there was a definition of weight balanced trees and a question regarding red-black trees. This question is to ask the same question, but for AVL trees. The question is, ...