write depthFirstSearch in graph.js