Question: What is the space complexity of a recursive function that uses a stack to perform depth-first search on a graph?
Options:
Correct Answer: O(n)
Solution:
The space complexity is O(n) due to the maximum depth of the recursion stack in the worst case.