In computer science, Brute-force algorithm refers to which of the following?
- A. A sorting algorithm that builds the final sorted array one element at a time by inserting each element into its correct position.
- B. A straightforward problem-solving approach that tries all possible solutions to find the correct one. ✓
- C. A search algorithm that checks each element in a list sequentially until the target value is found.
- D. A property of a sorting algorithm where elements with equal keys retain their original relative order.
Correct answer
B. A straightforward problem-solving approach that tries all possible solutions to find the correct one.
Explanation
Brute-force algorithm refers to a straightforward problem-solving approach that tries all possible solutions to find the correct one.