You can implement DFS iteratively with a stack, to eliminate the problems of recursive calls and call stack overflow. The implementation is very similar to BFS with queue - you just have to mark vertices when you pop them, not when you push them in the stack.