Chapter 1 - The Role of Algorithms in Computing Flashcards

1
Q

Informally, what is an algorithm?

A

Any well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values, as output. Thus it is a sequence of computational steps that transform the input into the output.

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

What is a well-specified computational problem?

A

A problem whose statement specifies in general terms the desired input/output relationship.

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

Provide a well-specified problem description of the sorting problem.

A

Input: A sequence of n numbers
Output: A permutation <a> of the input sequence such that a’1 <= a’2 <= … <= a’n</a>

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

Given the input sequence <31, 41, 59, 26, 41, 58>, what should a sorting algorithm return as output?

A

The sequence <26, 31, 41, 41, 58, 59>.

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

What is an instance of a problem?

A

An instance of a problem consists of the input needed to compute a solution to the problem. Each unique input to an algorithm is a new instance of the problem that algorithm aims to solve.

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

What does it mean when an algorithm solves the given computational problem.

A

That means that the algorithm is correct. That is, for every input instance, it halts with the correct output.

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

What might cause an algorithm to be incorrect?

A

For certain input instances an incorrect algorithm might halt with an incorrect answer, or it may not halt at all.

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

T/F Incorrect algorithms are never useful.

A

False, they can be useful if their error rate is controlled. However most of the time, we’re concerned with correct algorithms.

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

How can an algorithm be specified? What are the requirements that this specification must provide?

A

An algorithm can be specified in English, as a computer program, or even as a hardware design. The only requirement is that the specification must provide a precise description of the computational procedure to be followed.

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

What is a data structure?

A

A data structure is a way to store and organize data in order to facilitate access and modifications.

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

T/F No single data structure works well for all purposes.

A

True, it is important to know the strengths and limitations of several data structures.

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

What is the usual measure of efficiency for an algorithm?

A

Speed, or how long an algorithm takes to produce its result.

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

What is an NP-complete problem? What is unique about NP-complete problems?

A

NP-complete problems are problems for which no efficient algorithm has ever been found. However, NP-complete problems are different from other problems for which no efficient algorithm has been found because nobody has ever proven that an efficient algorithm for one cannot exist. In other words nobody knows whether or not efficient algorithms exist for NP-complete problems. NP-complete problems are even more unique because they have the remarkable property that is an efficient algorithm exists for any of them, then efficient algorithms exist for all of them. Several NP-complete problems are similar, but not identical, to problems for which efficient algorithms are known.

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

Other than speed, what other measures of efficiency might one use in a real-world setting?

A

Storage space, and cost-efficiency.

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

Are algorithms really that important in light of other advanced technologies?

A

Yes, algorithms should be considered a technology, just like advanced computer hardware. Total system performance depends on choosing efficient algorithms as much as on choosing fast hardware.

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