4.3 - Fundamentals of algorithms Flashcards

1
Q

What are the applications of a breadth first search?

A

Finding the shortest path on an unweighted graph.

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

What are the applications of a depth first search?

A

Navigating a maze.

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

What is pre-order tree traversal used for?

A

Copying a tree.

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

What is in-order tree traversal used for?

A

Navigating a binary search tree. Outputting the contents of a binary search tree in ascending order.

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

What is post-order tree traversal used for?

A

Infix to RPN (Reverse Polish Notation) conversions, producing a postfix expression from an expression tree, emptying a tree.

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

What are the benefits of reverse-polish?

A

Eliminates need for brackets in sub-expressions.

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

What algorithm has a time complexity of O(log n)?

A

Binary tree/search.

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

What algorithm has a time complexity of O(n^2)?

A

Bubble sort.

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

What algorithm has a time complexity of O(nlog n)?

A

Merge sort.

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