Which statement correctly explains Depth-first search (DFS)?
- A. A divide-and-conquer sorting algorithm that splits the array, sorts each half, and merges them.
- B. A divide-and-conquer sorting algorithm that partitions elements around a pivot value.
- C. A measure of the amount of time an algorithm takes to run as a function of input size.
- D. A graph traversal algorithm that explores as far as possible along each branch before backtracking. ✓
Correct answer
D. A graph traversal algorithm that explores as far as possible along each branch before backtracking.
Explanation
Depth-first search (DFS) refers to a graph traversal algorithm that explores as far as possible along each branch before backtracking.