Explain the time and space complexity of your recursive versus iterative depth-first search (DFS) implementations.