Dfs using recursion

getting segmentation fault while running the program.