Question: I need to code this in Java. My DFS method needs to be : public static ArrayList pathDFS(Integer source, Integer destination, WGraph graph){ ArrayList Stack

 I need to code this in Java. My DFS method needs

I need to code this in Java.

My DFS method needs to be :

public static ArrayList pathDFS(Integer source, Integer destination, WGraph graph){ ArrayList Stack = new ArrayList();

///Your code starts here:

//Your code ends here

return Stack;

}

I have multiple helper method in the Graph class, such as :

getEdge(Integer node1; Integer node2);

listOfEdgesSorted();

getNbNodes();

Thanks!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!