Lecture 7 Flashcards

1
Q

What are the runtimes of sorted arrays?

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

What are the three pointers every node has in a binary search tree?

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

What property do all keys follow in a Binary Search Tree?

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

Are BST’s unique?

A

No, multiple BST can follow the BST key property

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

How to do search in a BST?

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

What is the pseudocode for search in BST?

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

How to find min/max in a BST?

A
When looking for max change left into right
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the pseudocode for max/min in a BST? What is the runtime?

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

How to do insert in a BST?

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

What is the pseudocode of insert in a BST? What is the runtime?

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

What are the ideas of the steps of deleting in a BST?

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

What are the steps of removing an element of a BST which has one child?

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

What are the steps of removing an element of a BST which has two children?

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

What is the best case of Search, Insert and Deleting of a BST? When does this happen?

A

O(log2(n)), when the BST is perfectly balanced

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

What is the worst case of Search, Insert and Deleting of a BST? When does this happen?

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

What is a Red-Black tree? What is its key idea?

A
17
Q

What properties does a RB tree follow?

A
18
Q

What is black-height?

A
19
Q

What is the height of a RB tree?

A
20
Q

What are the order of operations in a RB tree?

A

O(log2(n))