Fundamentals of algorithms Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What are the 2 types of graph-traversal?

A

Depth-first and breadth-first

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

What are the 3 types of tree traversal?

A

Pre-order, In-order, Post-order

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

What does a pre-order traversal give you?

A

A copy of the tree.

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

What does an in-order traversal give you?

A

Gives you the contents of the tree in ascending order

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

What does a post-order traversal give you?

A

Gives you the reverse polish notation

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

What data structure does reverse polish mimic?

A

A stack

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

What is the time complexity of a linear search?

A

O(n)

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

What is the time complexity of a binary search?

A

O(logn)

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

What is the time complexity of a bubble sort?

A

O(n^2)

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

What is the time complexity of a merge sort?

A

O(nlogn)

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