Unit 6-Part 3 Flashcards
(6 cards)
1
Q
When does an AVL tree balance itself?
A
During the addition or removal of a node
2
Q
How long does searching take for an AVL tree?
A
O(logn)
3
Q
How long does insertion take for an AVL tree?
A
O(logn)
4
Q
Which tree is more balanced? AVL or Red Black Trees?
A
AVL trees are more balanced
-but cause more rotations during insertions and deletions
5
Q
Which tree should be used when there frequent insertions and deletions?
A
Red-Black Trees
6
Q
Which tree should be used when insertions and deletions are less frequent and search is more frequent?
A
AVL trees