Shouldn’t the (5,3) edge be (3,5) to include 5 in the graph’s dfs?
Course: Algorithms for Coding Interviews in Java - Learn Interactively
Lesson: Solution Review: Print all the Connected Components of a Graph - Algorithms for Coding Interviews in Java