Algorithms (7.1, 7.2, 7.8) Flashcards

1
Q

a sequence of steps that solves a problem, or generates a calculation.

A

algorithm

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

The number of calculations required to solve a problem.

A

algorithm time efficiency

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

A _____ specifies: an input, a question about that input that can be answered using a computer, and the desired output.

A

computational problem

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

_____ are a set of problems for which no known efficient algorithm exists.

A

NP-complete problems

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

Is algorithm development started before, during, or after writing a program?

A

Before

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

A name created by a programmer for an item like a variable or function. Must be a sequence of letters, underscores, and digits or start with a letter or underscore. They are case sensitive.

A

Identifier

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

Special value indicating the end of a list, such as a list of positive integers ending with 0.

A

Sentinel Value

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

Can be a number, a variable name (numApples), or a simple calculation like (numApples + 1).

A

Expression

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

A program performs computations on that data, such as adding two values like x + y.

A

process

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

A list of statements executed by invoking the function’s name, with such invoking know as a function call.

A

function

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

Any function input values that appear within ( ), and are separated by commas if more than one.

A

arguments

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

A value provided to a function’s parameter during a function call.

A

argument

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

A named list of statements

A

function

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

Dividing a nonzero floating-point number by zero.

A

+ or - infinity

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

A function may return one value and does so by assigning a ___ with the return value.

A

return variable

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

A conversion of one data type to another, such as an integer to a float.

A

type conversion

17
Q

evaluates to the remainder of the division of two integer operands. Ex: 23 % 10 is 3.

A

modulo operator