Algorithms Flashcards

(18 cards)

1
Q

What is an algorithm?

A

A sequence of steps taken to solve a problem.

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

What is the most important when it comes to creating algorithms?

A

Correctness

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

What is algorithm time efficiency?

A

The number of calculations required to solve a problem.

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

How does a linear search work?

A

Checks each number from start to finish.

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

How does binary search work?

A

First, it checks the middle of the specified range. For example, a contact list might start at “M”; if looking for “H”, it would search the upper half, starting at the midpoint between A and L. This continues until the search finds the specified letter.

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

How many searches does binary usually require?

A

10

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

How many searches does linear usually require?

A

For 500 items, usually 250 searches.

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

What is a computational problem?

A

An input that is answered by using a computer.

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

What is required for a computational problem?

A

problem input, question to be answered and desired output

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

What ways can an algorithm be described?

A

English, Pseudocode, programming language, hardware, etc.

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

What is computational complexity?

A

The amount of resources it takes to run an algorithm. Mostly runtime and memory.

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

What is NP-Complete?

A

A problem where there isn’t a known efficient algorithm.

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

What does space complexity mean?

A

represents the number of fixed memory units.

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

What does runtime complexity mean?

A

number of constant-time operations performed by the algorithm.

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

What is the difference between axillary space complexity and space complexity?

A

axillary space complexity does not include input data.

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

When is binary search benefitical?

A

When the items being searched are sorted.

17
Q

What is heuristic?

A

A less accurate way to improve execution speed for algorithms that do not have the needed computational resources.

18
Q

Is “The pool’s water level is low. What should be added.” an algorithm? Why.

A

No, because an algorithm consists of steps.