Chapter 4: Performance Flashcards

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

5-step approach to the scientific method

A
  • Observe some feature of the natural world
  • Hypothesize a model that is consistent with the observations
  • Predict events using the hypotheses
  • Verify the predictions by making further observations
  • Validate by repeating until the hypothesis and observations agree
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Empirical analysis

A

A method whereby one develops a doubling hypothesis to double the size of the input and observe the effect on the running time.

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

2 Primary factors determining running time (Knuth)

A
  • Cost of executing each statement

- The frequency of execution of each statement

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

Constant order of growth program

A

A program that executes a fixed number of statements to finish its job; consequently its running time does not depend on the problem size.

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

Linear order of growth program

A

A program whose running time is directly proportional to the problem size.
Ex.
Programs that spend a constant amount of time processing each piece of input data, or that are based on a single for loop.

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

Linearithmic order of growth program

A

A program whose running time for a problem of size N has order of growth N log N.

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

Quadratic order of growth program

A

N^2 order of growth
Ex.
Two nested for loops, used for some calculation involving all pairs of N elements.

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

Cubic order of growth program

A

N^3 order of growth
Ex.
Three nested for loops (Running time of matrix multiplication).

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

Exponential algorithm

A

Algorithm whose order of growth is b^N for any constant b>1

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