Secureworks interview question

Write a DFS search. Now do it without recursion.