SCRIPTING-AND-PROGRAMMING-FOUNDATIONS practice question 21 of 25

What is an example of an algorithm?

Full set: 137 questions
Answer options
A: The sign of two integers determines the sign of the product.
B: The list contains apples, bananas, and oranges.
C: A webpage uses an HTML file type.
D: Unplug the device, wait 30 seconds, and restart the device. Correct answer
Correct Answer:
D. Unplug the device, wait 30 seconds, and restart the device.
Explanation

An algorithm is a finite, ordered sequence of well-defined steps designed to solve a specific problem or perform a computation. The instructions "Unplug the device, wait 30 seconds, and restart the device" constitute a clear, step-by-step procedure to achieve a specific outcome (troubleshooting a device), which perfectly aligns with the definition of an algorithm.

Why Incorrect

A. This is a mathematical property or rule, not a sequence of executable steps to solve a problem.
B. This describes a data collection (a list of items), not a process or a set of instructions.
C. This is a statement of fact about a file's technical specification, not a procedural algorithm.

References

1. Cormen, T. H., Leiserson, C. E., Rivest, R. L., & Stein, C. (2009). Introduction to Algorithms (3rd ed.). MIT Press. In Section 1.1, an algorithm is defined as "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."

2. Guttag, J. V. (2013). Introduction to Computation and Programming Using Python. MIT Press. Chapter 2 discusses algorithms as "a sequence of simple steps."

3. Knuth, D. E. (1997). The Art of Computer Programming, Vol. 1: Fundamental Algorithms (3rd ed.). Addison-Wesley. Section 1.1 defines an algorithm by five features: finiteness, definiteness, input, output, and effectiveness. Option D exhibits these features.

Scroll to Top