Check your understanding of the previous reading: what makes a good program, ways to measure how long a program takes, and the constant, linear and quadratic relationships.
What three criteria are commonly used to evaluate a program?
Select every answer that applies, then check.
Match each description to its most accurate label.
| # | Description | Label |
|---|---|---|
| 1 | Measuring the actual time taken by the program. | |
| 2 | Estimating the time each statement of a program will take via a simplified model of execution. | |
| 3 | The number of statements in the program. |
The reading covers three ways to measure the length of a program: counting, timing it with a watch, and estimating by tracing it with a simplified model.
1 Wall Clock Time (start a watch when the program begins, stop it when it ends), 2 RAM Model (most simple actions take one step), 3 Lines of Code (easy, but very inaccurate). Quadratic Growth, Time Equation and Random Guessing are not ways to measure a program.
Put these mathematical relationships in order from slowest to fastest growth relative to each other.
Drag the items into order, or use the arrow buttons, then check.
A constant relationship doesn't grow with the size of the input at all; a linear one takes a constant amount of extra time for every extra element; a quadratic one takes a linear amount of extra time for every extra element, so it grows fastest.