AVL vs Heaps Flashcards

1
Q

What is the height of a binary heap?

A

Theta(log(n))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How does Insertion work for a heap?

A

Insert at the next available leaf

Fix up until Heap Order property is upheld

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the complexity of Heap Insertion?

A

O(log(n))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does deleteMax for for a Heap?

A

Replace the root by the last leaf

FixDown

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the complexity of deleteMax

A

O(log(n))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the height of a AVL tree?

A

Theta(log(n))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the complexity of AVL Insert?

A

BSTInsert -> Theta(log(n))
Update heights above => Theta(log(n))
Rotate if needed => constant

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the complexity of AVLDelete

A

BSTDelete => Theta(log(n))
Updates heights above => Theta(log(n))
Rotate if needed => constant

How well did you know this?
1
Not at all
2
3
4
5
Perfectly