Foundations-of-Computer-Science practice question 7 of 15
Which of the following best defines an algorithm?
Full set: 71 questionsAn algorithm is a well-defined, step-by-step procedure or set of rules designed to solve a specific problem or perform a computation. A key characteristic of an algorithm is that it must be finite, meaning it is guaranteed to terminate after a certain number of steps. It must also be unambiguous, with each step being precisely defined, to ensure a correct and predictable outcome for a given input.
A. A random collection of computer parts: This describes computer hardware, not a logical process for problem-solving.
C. A type of monitor resolution: This is a specification for a display device, indicating the number of pixels, and is unrelated to algorithms.
D. A storage device used for backups: This describes a hardware component used for data preservation, not a computational method.
1. Cormen, T. H., Leiserson, C. E., Rivest, R. L., & Stein, C. (2009). Introduction to Algorithms (3rd ed.). MIT Press. Chapter 1, Section 1.1, "Algorithms," defines an algorithm 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. Knuth, D. E. (1997). The Art of Computer Programming, Volume 1: Fundamental Algorithms (3rd ed.). Addison-Wesley. Section 1.1, "Algorithms," lists five key features of an algorithm, including finiteness.
Keep practicing
Take the free Foundations-of-Computer-Science practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other Foundations-of-Computer-Science practice questions
- Question 1What is the purpose of a parameter in a function definition?
- Question 2What is the primary purpose of an operating system?
- Question 3Which action is taken if the first number is the lowest value in a selection sort?
- Question 4What will the expression fam[3:6] return?
- Question 5What will the output be of this line?
- Question 6Which aspect is excluded from a NumPy array’s structure?
