SCRIPTING-AND-PROGRAMMING-FOUNDATIONS practice question 21 of 25
What is an example of an algorithm?
Full set: 137 questionsAn 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.
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.
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.
Keep practicing
Take the free SCRIPTING-AND-PROGRAMMING-FOUNDATIONS practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other SCRIPTING-AND-PROGRAMMING-FOUNDATIONS practice questions
- Question 1Which characteristic distinguishes a markup language from other languages?
- Question 2A program calculates the average miles per gallon given miles traveled and gas consumed H…
- Question 5Which characteristic specifically describes an object-oriented language?
- Question 6Which is one characteristic of an object-oriented language that is not a characteristic o…
- Question 7Which operation should be used to check if the difference of two values is greater than 1?
- Question 9A program allows the user to play a game. At the end of each game, the program asks the u…
