Adding DFS(on array) code