Binary Search Trees Flashcards

1
Q

What is a Heap?

A

A binary tree where each node U has a priority

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

In a Heap which node is the root?

A

The node with the minimum priority

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

What is a treap?

A

A binary tree where each node has a value and a priority

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

How are priority values assigned in a treap?

A

They are unique and assigned at random

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

Similar to a heap which node is the root?

A

The node with the smallest priority

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

What is the runtime of find, add and remove?

A

O(logn)

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

What is the expected length of a search path for a treap?

A

At most, 1.38log2n+2

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