DFS Approach

Consider again this graph with vertex S: