NVIDIA Interview Question

depth first search of a array in a non-recursive manner without using extra memory