Algorithms Flashcards

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

Define: Graph - Depth First Traversal

A

Explores down an entire branch before moving on. Uses a stack.

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

Define: Graph - Breadth First Traversal

A

Explores a whole level before moving down instead of using branches. Uses a queue.

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

Define: Recursive algorithm

A

A function which calls itself

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

What are the three essential characteristics of a recursive routine?

A

1) A base case must be included, when met means that the routine will not call itself and will start to “unwind”.
2) The stopping condition must be reached after a finite number of calls.
3) The algorithm must modify something that moves it towards the base case.

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

Define: Big-O Notation

A

Is a measure of the time complexity of an algorithm. It is a useful approximation to the actual number of steps in a computation

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

Define: Linear Search

A

Starts at beginning and continues until found or end. O(n).

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

Define: Binary Search

A

Goes to middle, then keeps splitting list in half until found/not found. Only works on ordered list. O(log2n).

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

Define: Tractable Problems

A

Problems that have a polynomial (or less) time solution are called tractable problems.

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

Define: Intractable Problems

A

Problems that have no polynomial (or less) time solution are called intractable problems.

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

Define: Heuristic Approach

A

Is one which tries to find a solution which may not be perfect but which is adequate for its purpose. A heuristic approach makes an ‘educated guess’ and uses common sense.

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

Define: Halting problem

A

Provides a definition for a non-computable problem.

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