4.3 Fundamentals of Algorithms Flashcards

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

What is the use of a breadth-first algorithm?

A

Shortest path for an unweighted graph.

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

What is the use of a depth-first algorithm?

A

Navigating a maze

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

What is the use of a pre-order tree-traversal algorithm?

A

Copying a tree

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

What is the use of a in-order tree-traversal algorithm?

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 the use of a post-order tree-traversal algorithm?

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 is the time complexity of a linear search algorithm?

A

O(n)

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

What is the time complexity of a binary search algorithm?

A

O(log 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 bubble sort algorithm?

A

O(n^2)

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

What is the time complexity of a merge sort algorithm?

A

O(nlog n)

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

What is the use of Dijkstra’s algorithm?

A

To find the shortest path

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